Impala Public Jenkins has submitted this change and it was merged. (
https://gerrit.cloudera.org/25263 )
Change subject: IMPALA-15213: Iceberg UUID Avro read support
......................................................................
IMPALA-15213: Iceberg UUID Avro read support
Iceberg stores UUID in Avro as fixed(16) with logicalType=uuid. Impala
now reads top-level UUID columns from Avro data files and UUID fields
nested inside STRUCT columns when write.format.default is Parquet or ORC
(including the Impala default when the HMS property is unset).
With write.format.default=avro, a scan of a table with a complex column
is rejected in checkForSupportedFileFormats(), even for nested scalar
fields. With Parquet or ORC as the default, a scan that reads Avro data
files fails during planning if it materializes a STRUCT, ARRAY or MAP.
Nested scalar fields still read.
Backend:
- fixed(16) maps to UUID. New ReadAvroUuid() for the interpreted and
codegen paths.
- SchemasMatchForCodegen() accepts AVRO_FIXED.
- Named types reused in a schema are AVRO_LINKs. They are now
resolved to their target and recursive schemas are rejected.
- ResolveSchemas(): a missing struct field with a NULL default now
writes NULL to the slot and stops walking the path.
Frontend:
- Iceberg tables with Avro data files use an Avro reader schema built
from Impala column types (HMS is lossy for UUID). AvroSchemaConverter
maps UUID to fixed(16)+logicalType uuid, VARIANT to
record{metadata,value} bytes (same as HMS), and sets Schema.NULL_VALUE
on top-level fields in convertColumns() so schema evolution matches
the old HMS path.
- Removed validateUuidReadSupported().
- HdfsScanNode.checkAvroComplexTypeReadSupported(): when fileFormats_
contains AVRO, reject materialized STRUCT, ARRAY and MAP slots at any
depth. It runs in init(), so the query fails at planning instead of
in the scanner.
Testing:
- E2E tests for Avro reads, predicates and joins with the Parquet and
ORC fixtures, including the write.format.default switch.
- Trino interop tests for Avro structs: nested scalars read with a
Parquet/ORC default; whole-struct selects rejected with an Avro
default and with a Parquet default; mixed Parquet/Avro files; and
ARRAY<UUID> rejection.
- AvroSchemaConverterTest, BE unit tests for ReadAvroUuid, AVRO_LINK
and nested recursive schemas.
- iceberg_uuid_test_avro is replaced by iceberg_uuid_test_avro_struct.
The rows match iceberg_uuid_test plus a struct column s (a int,
u uuid). The data file has id, uuid_col, name and s. Two metadata-only
schema changes add s.t and s2, which the data file does not have, so
the missing-field path is exercised.
Change-Id: Ic818ecad70f97f3646bbbb885de0b59420b28b44
Assisted-by: Claude Haiku 5.5 (Cursor)
Reviewed-on: https://gerrit.cloudera.org/25263
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/codegen/gen_ir_descriptions.py
M be/src/exec/avro/hdfs-avro-scanner-ir.cc
M be/src/exec/avro/hdfs-avro-scanner-test.cc
M be/src/exec/avro/hdfs-avro-scanner.cc
M be/src/exec/avro/hdfs-avro-scanner.h
M be/src/util/avro-util.cc
M fe/src/main/java/org/apache/impala/catalog/FeIcebergTable.java
M fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
M fe/src/main/java/org/apache/impala/catalog/IcebergTable.java
M fe/src/main/java/org/apache/impala/catalog/local/LocalFsTable.java
M fe/src/main/java/org/apache/impala/catalog/local/LocalIcebergTable.java
M fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
M fe/src/main/java/org/apache/impala/util/AvroSchemaConverter.java
A fe/src/test/java/org/apache/impala/util/AvroSchemaConverterTest.java
M testdata/data/README
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-36a10355-4da3-48cc-baa7-78a818130e15-1-00001.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-4e7c2ed8-d3ce-484c-8bc5-d0bd095c46d1-1-00001.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-e1248e53-2a33-434c-ba9e-4b0cde09f23a-1-00001.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-e290bcce-35c3-48d5-b592-da066823f124-1-00001.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-e6f6ea8e-0241-44c6-b214-1aa107927521-1-00001.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/2b500dae-2f17-4139-a3ab-749bf7d4d2b4-m0.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/2f0ca499-85fc-4cf7-a4d7-abf2f4a18a46-m0.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/c0ce300a-9874-4199-aa3a-abcae5b02ef7-m0.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/d1bbde7d-1667-454f-b354-5661c08c8e94-m0.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/d2878e39-671e-434e-a1cf-e6f49bb218b5-m0.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-1257189622857586261-1-d2878e39-671e-434e-a1cf-e6f49bb218b5.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-5325065939761959235-1-2b500dae-2f17-4139-a3ab-749bf7d4d2b4.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-6779792615814615855-1-d1bbde7d-1667-454f-b354-5661c08c8e94.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-9054099040941058343-1-2f0ca499-85fc-4cf7-a4d7-abf2f4a18a46.avro
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v1.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v2.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v3.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v4.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v5.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v6.metadata.json
D
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/version-hint.text
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/data/00000-0-23589981-ee08-4c39-9105-be5e33adbd33-1-00001.avro
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/9a198009-6b26-4aa5-9649-50522bcd55ee-m0.avro
R
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/snap-8419607375801408156-1-9a198009-6b26-4aa5-9649-50522bcd55ee.avro
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/v1.metadata.json
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/v2.metadata.json
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/v3.metadata.json
A
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro_struct/metadata/version-hint.text
M testdata/datasets/functional/functional_schema_template.sql
M testdata/datasets/functional/schema_constraints.csv
M
testdata/workloads/functional-query/queries/QueryTest/iceberg-trino-interop-uuid.test
M testdata/workloads/functional-query/queries/QueryTest/iceberg-uuid-type.test
M tests/query_test/test_iceberg.py
48 files changed, 734 insertions(+), 129 deletions(-)
Approvals:
Impala Public Jenkins: Looks good to me, approved; Verified
--
To view, visit https://gerrit.cloudera.org/25263
To unsubscribe, visit https://gerrit.cloudera.org/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic818ecad70f97f3646bbbb885de0b59420b28b44
Gerrit-Change-Number: 25263
Gerrit-PatchSet: 10
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>