JiajunBernoulli commented on code in PR #3382:
URL: https://github.com/apache/calcite/pull/3382#discussion_r1299644641
##########
core/src/test/java/org/apache/calcite/test/RelMetadataTest.java:
##########
@@ -700,6 +700,16 @@ final RelMetadataFixture sql(String sql) {
sql(sql).assertThatRowCount(is(7d), is(0D), is(7d));
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-5944">[CALCITE-5944]
+ * RelMdRowCount can return more accurate rowCount. </a>. */
+ @Test void testRowCountSample() {
+ sql("select * from emp tablesample bernoulli(50) repeatable(1)")
+ .assertThatRowCount(is(EMP_SIZE * 0.5), is(0D),
is(Double.POSITIVE_INFINITY));
Review Comment:
@LakeShen
The second parameter `0D` is MinRowCount.
The third parameter `Double.POSITIVE_INFINITY` is MaxRowCount.
So we have test for `getMaxRowCount(Sample rel, RelMetadataQuery mq)` and
`getMinRowCount(Sample rel, RelMetadataQuery mq)`.
--
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]