Skip to content

[CALCITE-1288] Avoid doing the same join twice if count(distinct) exists#247

Closed
gparai wants to merge 1 commit intoapache:masterfrom
gparai:MD-783ACM
Closed

[CALCITE-1288] Avoid doing the same join twice if count(distinct) exists#247
gparai wants to merge 1 commit intoapache:masterfrom
gparai:MD-783ACM

Conversation

@gparai
Copy link

@gparai gparai commented Jun 11, 2016

This change will allow AggregateExpandDistictAggregatesRule JOIN instance to generates multi-phases aggregates when we see a query with one distinct and one or more non-distinct aggregates

.build();
checkPlanning(program, "select emp.empno, count(*), avg(distinct dept.deptno) \n"
+ " from sales.emp emp inner join sales.dept dept \n"
+ " on emp.deptno = dept.deptno \n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the spaces before the line feeds? they are unncessary, but they turn into spaces at the ends of lines in RelOptRulesTest.xml which somebody's editor will mysteriously remove at some point in the future.

julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Jun 15, 2016
@gparai gparai force-pushed the MD-783ACM branch 2 times, most recently from 7cb85db to cf9e6bb Compare July 12, 2016 22:42
@gparai gparai force-pushed the MD-783ACM branch 3 times, most recently from c1554e1 to 81081a5 Compare September 10, 2016 04:00
@asfgit asfgit closed this in c7cbfdf Sep 11, 2016
ldming pushed a commit to ldming/mycalcite that referenced this pull request Sep 13, 2018
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Mar 16, 2026
apache#262)

…le (apache#247)

* Add an utility class named SqlTypeMappingRules that defines some
utilities to build type mappings;
* Add an interface named SqlTypeMappingRule for all the type mapping
rules;
* Add SqlTypeCoercionRule that defines the type coercion rules, add doc
about how to customize new rules;
* Rename SqlTypeAssignmentRules to SqlTypeAssignmentRule;
* SqlTypeAssignmentRule now only defines rules of type assignment;
* Add a new method SqlValidator.setSqlTypeCoercionRules to set up custom
type coercion rules.

Co-authored-by: yuzhao.cyz <yuzhao.cyz@gmail.com>
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Mar 16, 2026
apache#262)

…le (apache#247)

* Add an utility class named SqlTypeMappingRules that defines some
utilities to build type mappings;
* Add an interface named SqlTypeMappingRule for all the type mapping
rules;
* Add SqlTypeCoercionRule that defines the type coercion rules, add doc
about how to customize new rules;
* Rename SqlTypeAssignmentRules to SqlTypeAssignmentRule;
* SqlTypeAssignmentRule now only defines rules of type assignment;
* Add a new method SqlValidator.setSqlTypeCoercionRules to set up custom
type coercion rules.

Co-authored-by: yuzhao.cyz <yuzhao.cyz@gmail.com>
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