You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Raghav Jindal (Code Review)" <ge...@cloudera.org> on 2026/04/14 08:40:27 UTC

[Impala-ASF-CR] IMPALA-14877: Create optional nested fields for Iceberg tables

Raghav Jindal has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24188


Change subject: IMPALA-14877: Create optional nested fields for Iceberg tables
......................................................................

IMPALA-14877: Create optional nested fields for Iceberg tables

In IcebergSchemaConverter.fromImpalaType(), nested fields (list
elements, map values, and struct fields) were generated as required
(non-nullable) in the Iceberg schema. This is incompatible with the
Hive/Spark convention that fields are nullable (optional) by default.

When Spark or Hive reads an Iceberg table created by Impala, they
enforce the required/optional constraint strictly and reject null
values in positions that Impala marked as required.

This change fixes fromImpalaType() to use ofOptional/optional
instead of ofRequired/required for list elements, map values, and
struct fields, matching the Hive/Spark default convention.

Testing: Added IcebergUtilTest.testNestedFieldsAreOptional() to
verify the Iceberg type objects are optional, and
TestIcebergTable.test_nested_fields_are_nullable() to verify the
Iceberg metadata.json written to disk has the correct flags.

Change-Id: Ic9c7865357d76617a1e04f827f8df8690cba6c28
Generated-by: Cursor (claude-4.6-sonnet)
Made-with: Cursor
---
M fe/src/main/java/org/apache/impala/util/IcebergSchemaConverter.java
M fe/src/test/java/org/apache/impala/util/IcebergUtilTest.java
M tests/query_test/test_iceberg.py
3 files changed, 81 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/88/24188/1
-- 
To view, visit http://gerrit.cloudera.org:8080/24188
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9c7865357d76617a1e04f827f8df8690cba6c28
Gerrit-Change-Number: 24188
Gerrit-PatchSet: 1
Gerrit-Owner: Raghav Jindal <ra...@cloudera.com>

[Impala-ASF-CR] IMPALA-14877: Create optional nested fields for Iceberg tables

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/24188 )

Change subject: IMPALA-14877: Create optional nested fields for Iceberg tables
......................................................................


Patch Set 1:

(5 comments)

Thanks for fixing this!

http://gerrit.cloudera.org:8080/#/c/24188/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/24188/1//COMMIT_MSG@11
PS1, Line 11: incompatible
I would rather say 'unaligned' than 'incompatible'


http://gerrit.cloudera.org:8080/#/c/24188/1/fe/src/test/java/org/apache/impala/util/IcebergUtilTest.java
File fe/src/test/java/org/apache/impala/util/IcebergUtilTest.java:

http://gerrit.cloudera.org:8080/#/c/24188/1/fe/src/test/java/org/apache/impala/util/IcebergUtilTest.java@528
PS1, Line 528: Before the fix, list
             :    * elements, map values, and struct fields were all marked as required,
             :    * making Impala-created schemas incompatible with Hive and Spark.
Mentioning the Jira ticket ID is enough, we don't need historical context here.


http://gerrit.cloudera.org:8080/#/c/24188/1/tests/query_test/test_iceberg.py
File tests/query_test/test_iceberg.py:

http://gerrit.cloudera.org:8080/#/c/24188/1/tests/query_test/test_iceberg.py@86
PS1, Line 86: Before the fix, nested fields were incorrectly
            :     marked as required in the Iceberg schema metadata, making tables
            :     created by Impala unreadable by Spark and Hive when null values
            :     were present in nested positions.
            : 
            :     The fix is verified by reading the Iceberg metadata.json directly
            :     and asserting that element-required, value-required and struct field
            :     required flags are all false.
I don't think we need to be that verbose here. Maybe just mention the Jira ticket.


http://gerrit.cloudera.org:8080/#/c/24188/1/tests/query_test/test_iceberg.py@103
PS1, Line 103:     # Before the fix, element-required / value-required / required were
             :     # all true; they must be false to match the Hive/Spark convention.
We don't need these comments.


http://gerrit.cloudera.org:8080/#/c/24188/1/tests/query_test/test_iceberg.py@112
PS1, Line 112: # ARRAY: element must be optional (element-required: false).
We can remove this. Same goes for L115, L118.



-- 
To view, visit http://gerrit.cloudera.org:8080/24188
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9c7865357d76617a1e04f827f8df8690cba6c28
Gerrit-Change-Number: 24188
Gerrit-PatchSet: 1
Gerrit-Owner: Raghav Jindal <ra...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Fri, 17 Apr 2026 16:29:43 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-14877: Create optional nested fields for Iceberg tables

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24188 )

Change subject: IMPALA-14877: Create optional nested fields for Iceberg tables
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/22130/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


-- 
To view, visit http://gerrit.cloudera.org:8080/24188
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9c7865357d76617a1e04f827f8df8690cba6c28
Gerrit-Change-Number: 24188
Gerrit-PatchSet: 1
Gerrit-Owner: Raghav Jindal <ra...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Tue, 14 Apr 2026 09:37:52 +0000
Gerrit-HasComments: No