Skip to content

Conversation

@okumin
Copy link
Contributor

@okumin okumin commented Feb 7, 2026

What changes were proposed in this pull request?

Remove dynamic instantiation based on the Hive version. Most likely, the conditional instantiation was implemented when the related logic existed in Apache Iceberg, aiming to be effective for both Hive 2 and 3 with a single source code base. This is an example of Iceberg 1.3.0.
https://github.com/apache/iceberg/blob/apache-iceberg-1.3.0/mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergInputFormat.java

Why are the changes needed?

I think the reflections are no longer needed, and having them makes development a bit hard; e.g., code jumps are disabled.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit and integration test

@okumin okumin changed the title [WIP] HIVE-29446: Remove reflective instance creation in iceberg-handler HIVE-29446: Remove reflective instance creation in iceberg-handler Feb 7, 2026
Copy link
Contributor Author

@okumin okumin left a comment

Choose a reason for hiding this comment

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

I don't apply cosmetic changes suggested by Sonar Cloud in this PR because they are not directly related to where I changed.
https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6305&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true



public final class IcebergDateObjectInspectorHive3 extends AbstractPrimitiveJavaObjectInspector
public final class IcebergDateObjectInspector extends AbstractPrimitiveJavaObjectInspector
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This rename could be harmful if Hive includes an outdated Iceberg library. I don't think it happens.

@okumin okumin marked this pull request as ready for review February 7, 2026 13:40
Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

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

LGTM.

To me this looks safe and was in my bucket list. The rename thing also looks in general safe to me, but that is a public class unless anyone is using it or having a downstream client around, it is gonna break or they have to manage it if they want to support multiple versions.

Do you think we can skip the rename part?

@okumin
Copy link
Contributor Author

okumin commented Feb 10, 2026

@ayushtkn

The rename thing also looks in general safe to me, but that is a public class unless anyone is using it or having a downstream client around, it is gonna break or they have to manage it if they want to support multiple versions.
Do you think we can skip the rename part?

I agree. I reverted the renaming commit, and resolved a conflict with the latest master

@sonarqubecloud
Copy link

@okumin okumin merged commit 041503d into apache:master Feb 11, 2026
4 checks passed
@okumin okumin deleted the HIVE-29446-iceberg-hive-version branch February 11, 2026 01:39
@okumin
Copy link
Contributor Author

okumin commented Feb 11, 2026

@ayushtkn Thank you! I hope this would make it easy to develop the Iceberg storage handler a bit

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.

3 participants