danny0405 commented on a change in pull request #1155: [CALCITE-2991]
getMaxRowCount should return rowcount 1 for an aggrega…
URL: https://github.com/apache/calcite/pull/1155#discussion_r274789529
##########
File path: core/src/test/java/org/apache/calcite/test/RelMetadataTest.java
##########
@@ -678,6 +678,16 @@ private void checkRowCount(String sql, double expected,
double expectedMin,
checkRowCount(sql, 1D, 1D, 1D);
}
+ @Test public void testRowCountAggregateConstantKey() {
+ final String sql = "select count(*) from emp group by 1";
+ checkRowCount(sql, 1.4D, 0D, 1D);
+ }
+
+ @Test public void testRowCountAggregateConstantKeys() {
+ final String sql = "select count(*) from emp group by 1,4";
+ checkRowCount(sql, 1.4D, 0D, 1D);
+ }
Review comment:
For some sql engine, the group by 1 means group by the first field, we
better change to other group by keys instead of just integer.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services