Skip to content

HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column#6565

Merged
ayushtkn merged 5 commits into
apache:masterfrom
ramitg254:HIVE-29341
Jul 3, 2026
Merged

HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column#6565
ayushtkn merged 5 commits into
apache:masterfrom
ramitg254:HIVE-29341

Conversation

@ramitg254

@ramitg254 ramitg254 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

support initial default for struct

Why are the changes needed?

currently initial default specified for struct isn't get read and stays null.

Does this PR introduce any user-facing change?

yes initial default values will be seen in previous rows

How was this patch tested?

unit tests and ci results

Comment on lines +29 to +32
public enum DefaultMetadataPolicy {
WRITE_DEFAULT,
WRITE_AND_INITIAL_DEFAULT
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this at all, For ORC InitialDefault will be null and the end result will be same, at best we can directly pass isOrcTable if required. I won't though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, corrected it avoided passing this argument and applied initial defaults to struct via a method created in HiveSchemaUtil.java

(Earlier, I was trying to apply intial defualts directly in convert internal step so introduced this enum because passing isOrc boolean value as a method argument to the existing methods doesn't seem right so introduced this new argument to describe the purpose of adding this argument more clearly )

@ramitg254 ramitg254 changed the title HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column [WIP]HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column Jun 26, 2026
@ramitg254 ramitg254 requested a review from ayushtkn June 29, 2026 07:05
@ramitg254 ramitg254 changed the title [WIP]HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column HIVE-29341:Iceberg: [V3] NULL initial default for STRUCT column Jun 29, 2026

@Test
public void testSimpleSchemaConvertToIcebergSchema() {
void testSimpleSchemaConvertToIcebergSchema() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes are out of scope

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanx @ramitg254 for the work here.
Changes LGTM. There is one spotless warning around line length, I believe that can be fixed

ramitg254 added 5 commits July 3, 2026 15:17
Change-Id: Iefec29f3d2e320cd94e5944651d65e85471b5cb8
Change-Id: Iae36e3f24cdc1f1ced9e5cd827864e365ecc2a0b
Change-Id: Id2df9e65a64f876600882acffb6df2f628559e1e
Change-Id: If7fc697834eda9924177d648a9e96e8e149d7c7d
Change-Id: Ia7939110bf55576cef6f7cdca329bc49454dfd48
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@ayushtkn ayushtkn merged commit 9338455 into apache:master Jul 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants