Skip to content

HIVE-28347: Make a UDAF 'collect_set' work with complex types, even when map-side aggregation is disabled.#5323

Merged
deniskuzZ merged 6 commits into
apache:masterfrom
JeongDaeKim:HIVE-28347-4.0
Jul 22, 2024
Merged

HIVE-28347: Make a UDAF 'collect_set' work with complex types, even when map-side aggregation is disabled.#5323
deniskuzZ merged 6 commits into
apache:masterfrom
JeongDaeKim:HIVE-28347-4.0

Conversation

@JeongDaeKim

@JeongDaeKim JeongDaeKim commented Jun 26, 2024

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

UDAFs, collect_set and collect_list, won't work with complex types, if map-side aggregation is disabled. This PR will fix this bug.

Why are the changes needed?

When users disable the map-side aggregation feature("hive.map.aggr), collect_set doesn't work with complex types, such as struct.

Does this PR introduce any user-facing change?

No.

Is the change a dependency upgrade?

No.

How was this patch tested?

Tested with qtest (TestMiniTezCliDriver)

@JeongDaeKim JeongDaeKim changed the title HIVE-28347 Make a UDAF 'collect_set' work with complex types, even when map-side aggregation is disabled. HIVE-28347: Make a UDAF 'collect_set' work with complex types, even when map-side aggregation is disabled. Jun 26, 2024
//no map aggregation.
inputOI = parameters[0];
return ObjectInspectorFactory.getStandardListObjectInspector(
ObjectInspectorUtils.getStandardObjectInspector(inputOI));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we merge this case with PARTIAL1?

if (m == Mode.PARTIAL1 || m == Mode.COMPLETE) {
  ...

@okumin

okumin commented Jun 26, 2024

Copy link
Copy Markdown
Contributor

@JeongDaeKim Taking a glance, your finding and fix seems to be very reasonable. Could you please regenerate the result file of udaf_collect_set_2.q?

@JeongDaeKim

Copy link
Copy Markdown
Contributor Author

@okumin Thank you for a quick review! 👍

@okumin okumin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have done three things.
First, I checked that the evaluator is likely correctly implemented now.
Second, I checked that we have new regrettion tests. Nice work.
Third, I ran the original udaf_collect_set_2.q with set hive.map.aggr = true or false. Both generated the same result set.

Then, the changes here look to me. Note that you also need +1 from a committer.

@deniskuzZ deniskuzZ 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.

LGTM +1

@deniskuzZ

Copy link
Copy Markdown
Member

thanks @JeongDaeKim! I'll merge it with the next green build

@sonarqubecloud

Copy link
Copy Markdown

@deniskuzZ
deniskuzZ merged commit 1969eda into apache:master Jul 22, 2024
@JeongDaeKim
JeongDaeKim deleted the HIVE-28347-4.0 branch July 22, 2024 22:07
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Aug 7, 2024
…hen map-side aggregation is disabled (Jeongdae Kim, reviewed by Shohei Okumiya, Denys Kuzmenko)

Closes apache#5323
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.

5 participants