Open pulparindo opened 1 year ago
Hello, @elonazoulay @findepi
If you have any update on what is the expected behavior here in trino with respects to avro.schema.literal
in this case, would be much appreciated. Thanks
Can you try with the latest version? We have a new Avro reader implementation in Trino now.
cc @jklamer
When decoding a timestamp as bigint (millis) column from an Avro based table throws the following error:
Steps for repro:
When executing 3. the query throws such error.
Is this a valid scenario in Trino? Is this issue by design?
I see that when creating the encoders in GenericHiveRecordRecursos class, there is not a valid option for bigint, because the creation of such encoders is based on the table columns definition and not in the avro schema definition (long with timestamp-mills logical annotation) https://github.com/trinodb/trino/blob/f431c3a9aed79917c99665b452773cffd5ac48c6/plugin/trino-hive/src/main/java/io/trino/plugin/hive/GenericHiveRecordCursor.java#L168
However, at the moment of reading the long, the conversion falls as an instance of Timestamp (shortTimestamp) https://github.com/trinodb/trino/blob/f431c3a9aed79917c99665b452773cffd5ac48c6/plugin/trino-hive/src/main/java/io/trino/plugin/hive/GenericHiveRecordCursor.java#L304 but the encoder for the column doesn't exists.
The stack trace of the error is the following: