Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[NSE-1205] Fix: change the logic of iterator in ColumnarHashAggregateExec #1206

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackylee-ch
Copy link
Contributor

What changes were proposed in this pull request?

When there is a ShuffleExchange after HashAgg, whose agg func is Count, and there are no inputs passed to HashAgg, gazelle will return empty batch rather than return none empty batch with 0. The main reason for this problem is the iterator defined in ColumnarHashAggregateExec is invalid. Its hasNext would return different value if we called it twice without calling next func. And in ColumnarShuffleWriteExec, we would check hasNext twice before calling next.

How was this patch tested?

unit tests.

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/oap-project/native-sql-engine/issues

Then could you also rename commit message and pull request title in the following format?

[NSE-${ISSUES_ID}] ${detailed message}

See also:

@jackylee-ch jackylee-ch changed the title [NSC-1205] Fix: change the logic of iterator in ColumnarHashAggregateExec [NSE-1205] Fix: change the logic of iterator in ColumnarHashAggregateExec Jan 8, 2023
@github-actions
Copy link

github-actions bot commented Jan 8, 2023

#1205

@zhouyuan
Copy link
Collaborator

zhouyuan commented Jan 9, 2023

I tried to run the unit tests locally and find below tests failed:

com.intel.oap.tpc.ds.Orc_TPCDSSuite.smj query 3
com.intel.oap.tpc.ds.Orc_TPCDSSuite.q95 - shj
com.intel.oap.tpc.ds.TPCDSSuite.smj query 3
com.intel.oap.tpc.ds.TPCDSSuite.q95 - shj

-yuan

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants