Skip to content

HIVE-28400: Refactor QueryProperties feature flags to use QueryFeature enum#6560

Open
Manya0407 wants to merge 1 commit into
apache:masterfrom
Manya0407:refactor_queryproperties
Open

HIVE-28400: Refactor QueryProperties feature flags to use QueryFeature enum#6560
Manya0407 wants to merge 1 commit into
apache:masterfrom
Manya0407:refactor_queryproperties

Conversation

@Manya0407

@Manya0407 Manya0407 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

1.This PR refactors QueryProperties feature tracking from multiple boolean fields to an enum-based model.
2.Query feature flags such as GROUP_BY, ORDER_BY, LIMIT, PTF, WINDOWING, QUALIFY, EXCEPT, INTERSECT, USES_SCRIPT, and related clause flags are now represented by QueryFeature values stored in an EnumSet<QueryFeature>.
3.Relevant feature writer and reader call sites were updated to use addFeature(QueryFeature.X) and hasFeature(QueryFeature.X).
4.Compatibility wrapper methods such as hasGroupBy() and setHasGroupBy(boolean) continue to delegate to the enum-backed storage. Non-feature state such as join counts, query type, lateral view flags, view/materialized view flags, analyze flags, and used tables remains unchanged.

Why are the changes needed?

The previous implementation stored query features as many individual boolean fields, which made QueryProperties harder to read and extend.Using a QueryFeature enum with EnumSet keeps related feature state in one place, reduces repeated boolean field management, and makes adding future query features simpler and less error-prone.EnumSet is also efficient for enum values and is a good fit for representing query features.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual testing

@Manya0407 Manya0407 changed the title Refactor QueryProperties feature flags to use QueryFeature enum HIVE-28400: Refactor QueryProperties feature flags to use QueryFeature enum Jun 24, 2026
@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.

2 participants