Hi,

tuples are just a sub category of rows. Because the tuple arity is limited to 25 fields. I think the easiest solution would be to write your own converter that maps rows to tuples if you know that you will not need more than 25 fields. Otherwise it might be easier to just use a TextInputFormat and do the parsing yourself with a library.

Regards,
Timo


Am 23.08.18 um 18:54 schrieb françois lacombe:
Hi all,

I'm looking for best practices regarding Tuple<T> instances creation.

I have a TypeInformation object produced by AvroSchemaConverter.convertToTypeInfo("{...}"); Is this possible to define a corresponding Tuple<T> instance with it? (get the T from the TypeInformation)

Example :
{
  "type": "record",
  "fields": [
    { "name": "field1", "type": "int" },
    { "name": "field2", "type": "string"}
]}
 = Tuple2<Int,String>

The same question rises with DataSet or other any record handling class with parametrized types.

My goal is to parse several CsvFiles with different structures described in an Avro schema. It would be great to not hard-code structures in my Java code and only get types information at runtime from Avro schemas

Is this possible?

Thanks in advance

François Lacombe


Reply via email to