vineetgarg02 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_r274999323
##########
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:
@danny0405 This is a calcite test which I feel is descriptive enough to tell
users that group by keys are (or will be considered) constant here.
I can add another test with non-integer keys but I believe we should keep
this test as well.
----------------------------------------------------------------
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