julianhyde commented on a change in pull request #2439:
URL: https://github.com/apache/calcite/pull/2439#discussion_r686215557
##########
File path: core/src/test/java/org/apache/calcite/test/SqlToRelTestBase.java
##########
@@ -100,6 +102,8 @@
//~ Static fields/initializers ---------------------------------------------
protected static final String NL = System.getProperty("line.separator");
+ protected static final Supplier<RelDataTypeFactory>
DFLT_TYPE_FACTORY_SUPPLIER =
Review comment:
I don't see any benefit abbreviating 'DEFAULT' to 'DFLT'.
##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6769,4 +6771,43 @@ private void
checkJoinAssociateRuleWithTopAlwaysTrueCondition(boolean allowAlway
relFn(relFn).with(hepPlanner).checkUnchanged();
}
}
+
+ /**
+ * Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-4652">[CALCITE-4652]
+ * AggregateExpandDistinctAggregatesRule must cast top aggregates to
original type</a>.
+ *
+ * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM
aggregate
+ * is changed (expanded) by define custom type factory.
+ */
+ @Test void testDistinctCountWithExpandSumType() {
+ /* Expand SUM return type. */
+ RelDataTypeFactory typeFactory = new SqlTypeFactoryImpl(new
RelDataTypeSystemImpl() {
Review comment:
Use '//' not '/*' for comments.
"Expand SUM return type" doesn't adequately explain what you are doing here.
You're creating a new type system. Say why.
Rather than creating a typeFactory, I'd create a type factory supplier. I'd
assign the type system to a variable, to reduce nesting.
##########
File path: core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
##########
@@ -6769,4 +6771,43 @@ private void
checkJoinAssociateRuleWithTopAlwaysTrueCondition(boolean allowAlway
relFn(relFn).with(hepPlanner).checkUnchanged();
}
}
+
+ /**
+ * Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-4652">[CALCITE-4652]
+ * AggregateExpandDistinctAggregatesRule must cast top aggregates to
original type</a>.
+ *
+ * Checks AggregateExpandDistinctAggregatesRule when return type of the SUM
aggregate
Review comment:
Add `<p>`. Use one leading space, not two.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]