> On March 19, 2015, 6:35 p.m., Jinfeng Ni wrote: > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggBatch.java, > > line 72 > > <https://reviews.apache.org/r/32248/diff/1/?file=900140#file900140line72> > > > > Can you show example where you will expect to see "*" in the aggregate > > expression? For distinct * over schemaless table, I assume the * will > > appear in the GroupBy keys, not in the aggregated expressions. For count(*) > > as the agg expression, planner will replace * with a constant. So, I could > > not see why it is necessary to check if there is star in the aggregated > > expression. > > Sean Hsuan-Yi Chu wrote: > Oh... I was not aware of the planner's smart substitution of * in that > case. > > As of now, I agree with you. But let me think more about it. Thanks.
This issue was outdated and got resolved in the latest patch > On March 19, 2015, 6:35 p.m., Jinfeng Ni wrote: > > exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java, line > > 747 > > <https://reviews.apache.org/r/32248/diff/1/?file=900143#file900143line747> > > > > Have you consider the case where * comes from join? > > > > select distinct * from dept, emp where ... > > > > Seems the code you added will not work properly for such case. > > Sean Hsuan-Yi Chu wrote: > Hmmm~ I am not sure why that case could fail. > > As soon as Aggr sees '*' in the plan, it knows it should group-by respect > to all the columns. This logic seems to hold for JOIN as well to me. > > Besides, I tried some simple casesm such as: > > String queryDistinct = String.format("select distinct * " + > "from dfs.`%s` t1, dfs.`%s` t2 " + > "where (t1.a1 = t2.a1);", root, root); > (t1 and t2 are simply .json) > > DRILL gave the same result as Postgres. A test case was added - Sean Hsuan-Yi ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32248/#review77076 ----------------------------------------------------------- On May 28, 2015, 10:38 p.m., Sean Hsuan-Yi Chu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32248/ > ----------------------------------------------------------- > > (Updated May 28, 2015, 10:38 p.m.) > > > Review request for drill, Aman Sinha and Jinfeng Ni. > > > Bugs: DRILL-2139 > https://issues.apache.org/jira/browse/DRILL-2139 > > > Repository: drill-git > > > Description > ------- > > Expand * at the run time > > > Diffs > ----- > > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/AggregateUtils.java > PRE-CREATION > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/HashAggBatch.java > e1b5909 > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/aggregate/StreamingAggBatch.java > b252971 > > exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java > 8871a5f > exec/java-exec/src/test/java/org/apache/drill/TestDistinctStar.java > PRE-CREATION > exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java > d80e752 > > exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestHashAggr.java > 3786bfd > exec/java-exec/src/test/resources/store/text/data/repeatedRows.json > PRE-CREATION > > exec/java-exec/src/test/resources/testframework/testDistinctStar/testSelectDistinct.tsv > PRE-CREATION > > exec/java-exec/src/test/resources/testframework/testDistinctStar/testSelectDistinctExpression.tsv > PRE-CREATION > > exec/java-exec/src/test/resources/testframework/testDistinctStar/testSelectDistinctOverJoin.tsv > PRE-CREATION > > Diff: https://reviews.apache.org/r/32248/diff/ > > > Testing > ------- > > Unit and all QA tests passed. > > > Thanks, > > Sean Hsuan-Yi Chu > >
