Skip to content

Flatten FunctionCall as direct fields in AggregationNode#Aggregation#12789

Merged
hellium01 merged 3 commits intoprestodb:masterfrom
hellium01:FlattenAgg
May 15, 2019
Merged

Flatten FunctionCall as direct fields in AggregationNode#Aggregation#12789
hellium01 merged 3 commits intoprestodb:masterfrom
hellium01:FlattenAgg

Conversation

@hellium01
Copy link
Contributor

This is the first 3 commits of #12710

Copy link

Choose a reason for hiding this comment

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

Add ticket number to this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we need a ticket number since it will be added back in following commit.

@highker highker requested a review from wenleix May 12, 2019 00:35
@hellium01 hellium01 force-pushed the FlattenAgg branch 4 times, most recently from 5a86a40 to b108ac8 Compare May 13, 2019 20:12
@highker highker self-requested a review May 14, 2019 05:57
Copy link

@highker highker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Choose a reason for hiding this comment

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

Add @SuppressWarnings("unchecked") if you want; but not necessary.

Copy link
Contributor

@wenleix wenleix left a comment

Choose a reason for hiding this comment

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

"Add utility functions to convert SortOrder and OrderingScheme": LGTM, one nit.

Copy link
Contributor

@wenleix wenleix left a comment

Choose a reason for hiding this comment

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

"Add standard aggregation to StandardFunctionResolution". LGTM.

I remember seeing discussions to have them, just want to remember myself why we need them? (probably in a function related PR that @rongrong and @highker discussed? )

@hellium01
Copy link
Contributor Author

Thanks for reviewing, yes, I can use Expression instead of template in AnalyzedExpressionRewriter (will update that).

In optimization rules, we will likely to add some standard aggregation functions (one example place is StatisticAggregation in TableWriter) like count, max, min, adding them to FunctionResolution allows us to do that.

Copy link
Contributor

@wenleix wenleix left a comment

Choose a reason for hiding this comment

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

"Flatten FunctionCall as direct fields in AggregationNode#Aggregation" . Some comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm... AnalyzedExpressionRewriter sounds a bit vague... let's talk in person quickly to figure out a better name (or decided that's the best name and we just need some comments.. 😃 )

Copy link
Contributor Author

@hellium01 hellium01 May 14, 2019

Choose a reason for hiding this comment

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

As discussed offline, will add a Deprecated Mark over there and keep the name as is.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm.. should this expressionType be served as context? Let's talk in person.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed offline, will update to use a RewriterProvider

@hellium01 hellium01 force-pushed the FlattenAgg branch 5 times, most recently from 86ab56a to 92ab142 Compare May 14, 2019 21:25
@hellium01 hellium01 requested a review from wenleix May 14, 2019 21:35
Copy link
Contributor

@wenleix wenleix left a comment

Choose a reason for hiding this comment

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

The refactor into AnalyzedExpressionRewriter part looks good. I didn't look deep into the "flatten" logic part since it get reviewed in #12710

Previously these information is stored in `FunctionCall`, which is an
`Expression`. This is required by following commits which will make
AggregationNode to use `RowExpression` instead of `Expression`.
@hellium01 hellium01 merged commit 13e1d0b into prestodb:master May 15, 2019
@hellium01 hellium01 deleted the FlattenAgg branch May 15, 2019 01:52
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.

4 participants