Aggregation Pushdown for Druid connector#14224
Conversation
zhenxiao
commented
Mar 7, 2020
highker
left a comment
There was a problem hiding this comment.
Could you help going over the patch and fix those nits?
presto-druid/src/main/java/com/facebook/presto/druid/DruidAggregationProjectConverter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
nit: replace the space with a period a the end.
presto-druid/src/main/java/com/facebook/presto/druid/DruidAggregationProjectConverter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
01dd5e9 to
c8e75f8
Compare
|
thank you, @highker |
luohao
left a comment
There was a problem hiding this comment.
Half way done. Will take a look at the rest.
There was a problem hiding this comment.
so this refers to query without Group By clause?
There was a problem hiding this comment.
query with Group By, but no aggregations, e.g. count(*)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
yep, will add in following PRs. Start with easy ones :)
There was a problem hiding this comment.
Is count the only aggregation function in this case?
There was a problem hiding this comment.
yep, count(*) is the only case
c8e75f8 to
d8b92c3
Compare
There was a problem hiding this comment.
yep, will add in following PRs. Start with easy ones :)
There was a problem hiding this comment.
query with Group By, but no aggregations, e.g. count(*)
There was a problem hiding this comment.
yep, count(*) is the only case
There was a problem hiding this comment.
if (!...) {
throw new
}
// remove the `else`
presto-druid/src/main/java/com/facebook/presto/druid/DruidQueryGenerator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
break after .stream()
aggregationNode.getCallExpression().getArguments().stream()
.filter(...
.map..There was a problem hiding this comment.
oh, my bad. Let me fix it
presto-druid/src/test/java/com/facebook/presto/druid/TestDruidQueryGenerator.java
Outdated
Show resolved
Hide resolved
d8b92c3 to
d4d132f
Compare
|
thank you @highker |
presto-druid/src/test/java/com/facebook/presto/druid/TestDruidQueryGenerator.java
Outdated
Show resolved
Hide resolved
d4d132f to
36a28ed
Compare
|
@luohao am going to merge this PR soon. Could you please take a look, see if any problems? |