Skip to content

HIVE-25125:PTF: Vectorize percent_rank function - #6752

Open
ramitg254 wants to merge 6 commits into
apache:masterfrom
ramitg254:HIVE-25125
Open

HIVE-25125:PTF: Vectorize percent_rank function#6752
ramitg254 wants to merge 6 commits into
apache:masterfrom
ramitg254:HIVE-25125

Conversation

@ramitg254

@ramitg254 ramitg254 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Change-Id: I6fb4153d87bf92fd1c1993c79396465319d6b45a

What changes were proposed in this pull request?

Vectorize percent_rank() function.

Why are the changes needed?

percent_rank() currently executes in non vectorized fashion, so enabling it to also be supported in vectorized manner

Does this PR introduce any user-facing change?

No

How was this patch tested?

added q test and ci results

@ramitg254 ramitg254 changed the title [WIP] HIVE-25125:PTF: Vectorize percent_rank function Sep 3, 2026
Comment thread ql/src/java/org/apache/hadoop/hive/ql/plan/VectorPTFDesc.java Outdated
-- 9. Test Windowing Functions
-- SORT_QUERY_RESULTS

-- Vector PTF does not buffer PARTITION BY columns (constant within a partition). When a partition

@deniskuzZ deniskuzZ Sep 5, 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.

should we add an explicit guard over letting it fail with a ClassCastException or better even fall back to non-vector PTF ?

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 was thinking it should be evaluator specific in vectorised mode like here I ran into this in case of sum which should be computed for partition column not via buffered column values but via (constant partition column value* no. of rows in the partition) but since currently it only works via buffered column approach where we don't have partition column so index mapping is wrong in that case,

I think it would need some investigation regarding which evaluators should support it or not and should be made evaluator specific rather than a generic exception thrown?
I didn't created a ticket yet for it, if you think that makes then I'll create one and add the todo here, wdyt?

@deniskuzZ deniskuzZ Sep 8, 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.

please check that unsupported case is fall-backed to non-vectorized mode, otherwise it's a functional regression

@ramitg254 ramitg254 Sep 11, 2026

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 added non-vectorized fallback in Vectorizer.java and also tests to cover that case in vector_ptf_unbuffered_partition_col.q , please have a look

Change-Id: I6fb4153d87bf92fd1c1993c79396465319d6b45a
Change-Id: Idf1f2de5d9d0ffa810552eb84809105832661954
Change-Id: I7a7cda2764c072a7b6aa5d9f0a8eb1dc61299640
Change-Id: Ic5ea75acc155ef3acda512312acf00cf47c49eaf
Change-Id: Ia2d3cb09ee72b6e1d6347ac39321e1822b236049
Change-Id: Ib172b92c10e6d34fd3c43e40b587936cd233a651
@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.

3 participants