Skip to content

HIVE-29838 - #6726

Open
okumin wants to merge 6 commits into
apache:masterfrom
okumin:HIVE-29838-partition
Open

HIVE-29838#6726
okumin wants to merge 6 commits into
apache:masterfrom
okumin:HIVE-29838-partition

Conversation

@okumin

@okumin okumin commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

@okumin
okumin force-pushed the HIVE-29838-partition branch from 1de2036 to b8bf908 Compare August 27, 2026 00:58
@okumin okumin changed the title [WIP] HIVE-29838 Aug 29, 2026
@okumin
okumin marked this pull request as ready for review August 29, 2026 03:51
@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

Is JIRA ID correct ? Can't view it
Screenshot 2026-09-02 at 10 59 25 PM

return true;
}
String name = component.getName();
if (UNTRUSTED_DENIED_CLASS_NAMES.contains(name)) {

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.

this will disallow the three udfs globally, can them be configured from hive.server2.builtin.udf.blacklist, and checked within PartitionExpressionForMetastore.java‎

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.

IMO, HMS should not resolve HS2's configurations in most cases. Also, hive.server2.builtin.udf.blacklist is usually configured via SettableConfigUpdater. It is not easy to ensure that the class is invoked from HMS. Since these three classes aren't helpful for filtering out partitions, I'd say banning them doesn't introduce a new issue.

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.

Make sense, since this is only for HMS to prune partitions, Can we move the validation to PartitionExpressionForMetastore.java‎

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.

I have two reasons to prefer the current style. (1) The current implementation is robust since the fix is applied at the Kryo level; no Serde issue occurs. (2) I guess we can share the restriction with SARG.

return true;
}
}
return false;

@dengzhhu653 dengzhhu653 Sep 9, 2026

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.

this might disable the customer class in their udf, why should we restrict the class as we can limit the udf to be used?

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.

Your point is understandable, but I don't have an effective way to restrict only what we really want to block.
One option is to disallow non-built-in UDFs as well. This could be reasonable. Does anyone want to extend the reflective partitioning filtering beyond standard UDFs? If not, we may remove L330-332.

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.

we can restrict the udf to be built-in UDFs, at least in HS2 the pushed predicate should be built-in functions(PartitionPruner#hasUserFunctions)

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.

Done.
2fc8654

@sonarqubecloud

Copy link
Copy Markdown

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