You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "JiajunBernoulli (via GitHub)" <gi...@apache.org> on 2023/08/15 01:58:04 UTC

[GitHub] [calcite] JiajunBernoulli commented on a diff in pull request #3357: [CALCITE-5906] JDBC adapter should generate TABLESAMPLE

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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org