@ SuppressWarnings ( "unchecked" ) public static < T extends SpecificRecord > TypeInformation < Row > convertToTypeInfo ( Class < T > avroClass ) { Preconditions . checkNotNull ( avroClass , "Avro specific record class must not be null." ) ; // determine schema to retrieve deterministic field order final Schema schema = SpecificData . get ( ) . getSchema ( avroClass ) ; return ( TypeInformation < Row > ) convertToTypeInfo ( schema ) ; }
Converts an Avro class into a nested row structure with deterministic field order and data types that are compatible with Flink s Table & SQL API .