cloud-fan commented on a change in pull request #34451:
URL: https://github.com/apache/spark/pull/34451#discussion_r739967125



##########
File path: 
external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/V2JDBCTest.scala
##########
@@ -284,4 +286,93 @@ private[v2] trait V2JDBCTest extends SharedSparkSession 
with DockerIntegrationFu
       testIndexUsingSQL(s"$catalogName.new_table")
     }
   }
+
+  def supportsTableSample: Boolean = false
+
+  test("Test TABLESAMPLE") {
+    if (supportsTableSample) {
+      withTable(s"$catalogName.new_table") {
+        sql(s"CREATE TABLE $catalogName.new_table (col1 INT, col2 INT)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (1, 2)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (3, 4)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (5, 6)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (7, 8)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (9, 10)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (11, 12)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (13, 14)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (15, 16)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (17, 18)")
+        sql(s"INSERT INTO TABLE $catalogName.new_table values (19, 20)")

Review comment:
       We can simplify it: `spark.range(10).select($"id" * 2, $"id" * 2 + 
1).write.insertInto(...)`




-- 
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: reviews-unsubscr...@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to