yihua opened a new pull request, #20879: URL: https://github.com/apache/hudi/pull/20879
### Describe the issue this Pull Request addresses closes #20878 The Avro Parquet writer takes parquet-avro's legacy two-level list layout, which cannot hold a null array element, so a write of such a row into a table of a non-native table format fails with "Array contains a null element", while the Spark row writer and the Flink writer already write the three-level layout. ### Summary and Changelog `HoodieAvroFileWriterFactory` now sets `parquet.avro.write-old-list-structure` for its file and stream Parquet writers when the table format is not native and the storage configuration does not set it, following the Spark row writer's rule: three-level unless `hoodie.parquet.writelegacyformat.enabled` or `parquet.avro.write-old-list-structure` asks for the legacy layout. As in the row writer, an explicit `hoodie.parquet.writelegacyformat.enabled` wins over the storage configuration. The write handles take the table format from the table config when the write config does not name it (the Streamer, standalone compaction and clustering, the Java client), and the append handle passes it to Parquet log blocks. The rule moves to `ParquetUtils#isLegacyListFormatConfigured`, shared by both writers. `TestHoodieAvroParquetListLayout` writes arrays with null elements through the file writer, the stream writer and a Parquet log block across table format, storage configuration and write config ; `TestHoodieJavaClientParquetListLayoutForTestFormat` inserts and upserts them through the Java client with a write config that does not name the table format. ### Impact New base files and Parquet log blocks of tables with a non-native `hoodie.table.format` written through the Avro writer use the three-level list layout unless a legacy layout is configured. Readers detect the layout per file, so existing files keep working. Native tables are unchanged. ### Risk Level low. Limited to tables of a non-native table format; an explicit setting still wins. ### Documentation Update none ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Enough context is provided in the sections above - [ ] 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]
