JiajunBernoulli commented on code in PR #3357:
URL: https://github.com/apache/calcite/pull/3357#discussion_r1294116801
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -360,6 +360,46 @@ private static String toSql(RelNode root, SqlDialect
dialect,
sql(query).ok(expected);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-5906">[CALCITE-5906]
+ * Add the visit(Sample e) implementation in RelToSqlConverter</a>. */
+ @Test void testTableSampleBernoulli() {
+ String query = "select * from \"product\" tablesample bernoulli(11)";
+ final String expected = "SELECT *\n"
+ + "FROM \"foodmart\".\"product\" TABLESAMPLE BERNOULLI(11.00)";
+ sql(query).ok(expected);
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-5906">[CALCITE-5906]
+ * Add the visit(Sample e) implementation in RelToSqlConverter</a>. */
+ @Test void testTableSampleBernoulliRepeatable() {
+ String query = "select * from \"product\" tablesample bernoulli(15)
repeatable(10)";
+ final String expected = "SELECT *\n"
+ + "FROM \"foodmart\".\"product\" TABLESAMPLE BERNOULLI(15.00)
REPEATABLE(10)";
+ sql(query).ok(expected);
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-5906">[CALCITE-5906]
+ * Add the visit(Sample e) implementation in RelToSqlConverter</a>. */
Review Comment:
JDBC adapter should generate TABLESAMPLE
--
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]