Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: COLLECT_LIST can now be applied to tables #3093

Closed
wants to merge 3 commits into from

Conversation

vcrfxia
Copy link
Contributor

@vcrfxia vcrfxia commented Jul 17, 2019

Description

Trying to apply the COLLECT_LIST UDAF to a table currently results in the error The aggregation function(s) (collect_list) cannot be applied to a table. This PR fixes the issue.

Testing done

Updated unit tests and added query translation tests.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@vcrfxia vcrfxia requested a review from a team as a code owner July 17, 2019 23:13
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

Thanks @vcrfxia! I always learn something new about Java... I feel like changing the signature of the methods shouldn't have changed anything because the instantiation of the Udaf was still a TableUdaf. Where is the check happening to make sure that the given instance is a TableUdaf?

@vcrfxia
Copy link
Contributor Author

vcrfxia commented Jul 18, 2019

Where is the check happening to make sure that the given instance is a TableUdaf?

@agavra here's the check:

if (TableUdaf.class.isAssignableFrom(udaf.getReturnType())) {
udafTypeSpec.superclass(GeneratedTableAggregateFunction.class);
} else {
udafTypeSpec.superclass(GeneratedAggregateFunction.class);
}

@blueedgenick
Copy link
Contributor

LGTM - thanks for fixing this up @vcrfxia !

@vcrfxia
Copy link
Contributor Author

vcrfxia commented Jul 20, 2019

Closing in favor of #3104, which is identical except targeted at an earlier branch.

@vcrfxia vcrfxia closed this Jul 20, 2019
@vcrfxia vcrfxia deleted the collect_list branch May 18, 2020 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants