Arnab Karmakar has uploaded this change for review. ( 
https://gerrit.cloudera.org/25263


Change subject: IMPALA-15212: Iceberg UUID Avro read support
......................................................................

IMPALA-15212: Iceberg UUID Avro read support

Iceberg stores UUID in Avro as fixed(16) with logicalType=uuid. Impala
now reads it into TYPE_UUID slots, at the top level and inside STRUCT
columns, and no longer rejects Avro data files for UUID columns.

Backend:
- fixed(16) maps to UUID. New ReadAvroUuid() for the interpreted and
  codegen paths.
- Named types reused in a schema are AVRO_LINKs. They are now
  resolved to their target; recursive schemas are rejected.
- A NULL nullable struct has no nested bytes in Avro, so its child
  slots were left set and read as 0000...-0000. They are now set to
  NULL (interpreted and codegen).
- Complex types are allowed on Avro scans of Iceberg tables only.
  Selecting a whole STRUCT, and ARRAY/MAP, are still unsupported.
- The "zstandard" Avro codec (used by Trino) was rejected as unknown.
  It now maps to ZSTD.
- ZstandardDecompressor::ProcessBlock() now works without a
  preallocated output buffer, using ZSTD_decompressBound(). This
  needs ZSTD_STATIC_LINKING_ONLY, defined in decompress.h.

Frontend:
- The Avro reader schema of Iceberg tables is built from Impala
  column types, because the HMS schema is lossy (UUID as string).
- Removed validateUuidReadSupported().

Testing:
- Consolidated the iceberg_uuid_test_avro fixture to include a
  nested struct; e2e tests for reads, predicates, NULL structs and
  joins with the Parquet and ORC fixtures.
- Trino interop tests for Avro structs, mixed Parquet/Avro files and
  ARRAY<UUID> rejection.
- BE unit tests for ReadAvroUuid, AVRO_LINK, recursive schemas and
  zstd frames with and without content size.

Change-Id: Ic818ecad70f97f3646bbbb885de0b59420b28b44
Assisted-by: Composer 2.5 (Cursor)
---
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 be/src/util/decompress-test.cc
M be/src/util/decompress.cc
M be/src/util/decompress.h
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
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
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-5d93e45a-0ae2-4ed2-9a34-a8e1eccf800d-1-00001.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-85661402-478c-4937-a675-82453cfb01e0-1-00001.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-dc348d6b-52ba-4fb9-bfde-22b8c144fc5d-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
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-e4e6af96-8dd8-47b0-8abd-15f3ed95e279-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
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/data/00000-0-f14dba17-814e-4c3f-9700-a4e831dce61f-1-00001.avro
D 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/2b500dae-2f17-4139-a3ab-749bf7d4d2b4-m0.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/2ea80da4-0e25-42da-b646-9bdfd3bee97f-m0.avro
D 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/2f0ca499-85fc-4cf7-a4d7-abf2f4a18a46-m0.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/646a9c4c-a6d3-4ebb-9482-da9896971ae3-m0.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/abbcf7a2-8d5e-4355-874a-1e0f7c0fc1b9-m0.avro
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/bd4585d1-6561-44ff-a22b-fab684794662-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
A 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/d6781fc1-f37b-4ec6-a4e0-5967999aa19f-m0.avro
R 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-5846968439690120620-1-abbcf7a2-8d5e-4355-874a-1e0f7c0fc1b9.avro
R 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-5966950726956797836-1-bd4585d1-6561-44ff-a22b-fab684794662.avro
R 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-6949188817868346971-1-d6781fc1-f37b-4ec6-a4e0-5967999aa19f.avro
R 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-7519036613068306020-1-646a9c4c-a6d3-4ebb-9482-da9896971ae3.avro
R 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/snap-8166938921092999243-1-2ea80da4-0e25-42da-b646-9bdfd3bee97f.avro
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v1.metadata.json
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v2.metadata.json
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v3.metadata.json
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v4.metadata.json
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v5.metadata.json
M 
testdata/data/iceberg_test/iceberg_uuid/iceberg_uuid_test_avro/metadata/v6.metadata.json
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-trino-interop-uuid.test
M testdata/workloads/functional-query/queries/QueryTest/iceberg-uuid-type.test
50 files changed, 652 insertions(+), 75 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/63/25263/1
--
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: newchange
Gerrit-Change-Id: Ic818ecad70f97f3646bbbb885de0b59420b28b44
Gerrit-Change-Number: 25263
Gerrit-PatchSet: 1
Gerrit-Owner: Arnab Karmakar <[email protected]>

Reply via email to