Skip to content

Aggregation Pushdown for Druid connector#14224

Merged
zhenxiao merged 1 commit intoprestodb:masterfrom
zhenxiao:druid-aggregation
Mar 17, 2020
Merged

Aggregation Pushdown for Druid connector#14224
zhenxiao merged 1 commit intoprestodb:masterfrom
zhenxiao:druid-aggregation

Conversation

@zhenxiao
Copy link
Collaborator

@zhenxiao zhenxiao commented Mar 7, 2020

== RELEASE NOTES ==

Druid Changes
* Aggregation Pushdown for Druid connector

@zhenxiao zhenxiao requested review from highker and luohao March 7, 2020 00:27
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.

Could you help going over the patch and fix those nits?

Copy link

Choose a reason for hiding this comment

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

not used

Copy link

Choose a reason for hiding this comment

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

nit: replace the space with a period a the end.

Copy link

Choose a reason for hiding this comment

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

Use if

Copy link

Choose a reason for hiding this comment

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

Having a public enum in a util class doesn't sound good. Can you make AggregationColumnNode a top-level class and call it DruidAggregationColumnNode? Put the enum and two implementations as the inner class of it.

Copy link

Choose a reason for hiding this comment

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

Move to the end of the class

Copy link

Choose a reason for hiding this comment

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

if

Copy link

Choose a reason for hiding this comment

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

leave a space after function:

Copy link

Choose a reason for hiding this comment

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

typo aggregatin

@zhenxiao zhenxiao force-pushed the druid-aggregation branch from 01dd5e9 to c8e75f8 Compare March 10, 2020 02:28
@zhenxiao
Copy link
Collaborator Author

thank you, @highker
comments addressed

@zhenxiao zhenxiao requested a review from highker March 10, 2020 02:30
Copy link
Contributor

@luohao luohao left a comment

Choose a reason for hiding this comment

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

Half way done. Will take a look at the rest.

Copy link
Contributor

Choose a reason for hiding this comment

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

so this refers to query without Group By clause?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

query with Group By, but no aggregations, e.g. count(*)

Copy link
Contributor

Choose a reason for hiding this comment

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

Druid seems to support more than just min/max/avg/sum. Some of them should have a mapping to Presto aggreation functions(https://druid.apache.org/docs/latest/querying/sql.html#aggregation-functions), while the others may not apply due to implementation(e.g., need to be careful with HLL).

Do you plan to add other functions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, will add in following PRs. Start with easy ones :)

Copy link
Contributor

Choose a reason for hiding this comment

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

what is PQL?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is count the only aggregation function in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, count(*) is the only case

@zhenxiao zhenxiao force-pushed the druid-aggregation branch from c8e75f8 to d8b92c3 Compare March 10, 2020 23:12
Copy link
Collaborator Author

@zhenxiao zhenxiao left a comment

Choose a reason for hiding this comment

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

thank you, @luohao
comments addressed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, will add in following PRs. Start with easy ones :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

query with Group By, but no aggregations, e.g. count(*)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, count(*) is the only case

@zhenxiao zhenxiao requested a review from luohao March 10, 2020 23:14
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.

nits mostly

Copy link

Choose a reason for hiding this comment

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

requireNonNull

Copy link

Choose a reason for hiding this comment

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

requireNonNull

Copy link

Choose a reason for hiding this comment

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

same

Copy link

Choose a reason for hiding this comment

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

if (!...) {
    throw new
}

// remove the `else`

Copy link

Choose a reason for hiding this comment

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

break after .stream()

aggregationNode.getCallExpression().getArguments().stream()
        .filter(...
        .map..

Copy link

Choose a reason for hiding this comment

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

this is always false

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, my bad. Let me fix it

Comment on lines 236 to 237
Copy link

Choose a reason for hiding this comment

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

merge this two ifs

Copy link

Choose a reason for hiding this comment

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

same

@zhenxiao zhenxiao force-pushed the druid-aggregation branch from d8b92c3 to d4d132f Compare March 16, 2020 20:52
@zhenxiao zhenxiao requested a review from highker March 16, 2020 20:54
@zhenxiao
Copy link
Collaborator Author

thank you @highker
comments addressed.

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.

one nit

@zhenxiao zhenxiao force-pushed the druid-aggregation branch from d4d132f to 36a28ed Compare March 16, 2020 23:45
@zhenxiao
Copy link
Collaborator Author

@luohao am going to merge this PR soon. Could you please take a look, see if any problems?

@zhenxiao zhenxiao merged commit ad1be42 into prestodb:master Mar 17, 2020
@caithagoras caithagoras mentioned this pull request Mar 29, 2020
9 tasks
@caithagoras caithagoras mentioned this pull request May 4, 2020
34 tasks
@zhenxiao zhenxiao deleted the druid-aggregation branch May 31, 2020 23:38
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