voonhous opened a new pull request, #21087: URL: https://github.com/apache/hudi/pull/21087
### Describe the issue this Pull Request addresses Closes #21074. Part of the #20757 split (see #17764). Stacked on #21086: the serializer decodes VECTOR values with `ParquetReadConversions.writeVector`. Only the last commit is new; review it [here](https://github.com/voonhous/hudi/compare/trino-21075-parquet-read-conversions...trino-21074-schema-avro-serializer). The diff against master shrinks to it once #21086 lands. ### Summary and Changelog `HudiAvroSerializer` converts between pages and Avro records from metastore types; it has no conversion for several `HoodieSchema` types and fails on some decimals from Avro log blocks. `HoodieSchemaAvroSerializer` is driven by the field's `HoodieSchema` and the column's `TrinoTypeMapper` type instead. - Per-field converters compiled once per field, from a switch over `HoodieSchemaType` with no default branch, so a new type does not compile until it is mapped. - `serialize` writes Avro-native values (`Utf8`, `ByteBuffer`, `GenericFixed`, ...), so a record survives the Avro binary round trip of payload merges. `buildRecordInPage` also accepts the java.time, `BigDecimal` and `UUID` values of a record decoded with logical-type conversions. - `toAvro` and `toBlock` are public for other readers. - First user: the archived timeline reader (`TrinoParquetFileReader`). `HudiUtil` gains `toSchemaTypedColumnHandle` and `toMetadataHiveType`. The LSM timeline schema is string, bytes and int only, so its handles type as before; the `SqlVarbinary` to `ByteBuffer` patch-up goes away. - `TrinoTypeMapper` leaves record fields that can only hold null out of a row type, at any depth. ### Impact None. The merge path stays on `HudiAvroSerializer` and `toColumnHandle` until data columns are typed from the Hudi schema (#21078). The archived timeline reader hands string fields to hudi-common as `Utf8` instead of `String`; every consumer reads them through `toString`. ### Risk Level low: covered by a round trip per `HoodieSchemaType` (nested, nulls, decimals rescaled to the column scale), the schema-typed handle and Hive-type fallback tests, and the existing archived timeline tests. ### Documentation Update none ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] Adequate tests were added if applicable -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
