huaxingao commented on a change in pull request #29939:
URL: https://github.com/apache/spark/pull/29939#discussion_r501481894



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
##########
@@ -221,4 +221,21 @@ class JDBCV2Suite extends QueryTest with 
SharedSparkSession {
       checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Row("bob", 4))
     }
   }
+
+  test("DataFrameReader: jdbc") {
+    withTable("h2.test.abc") {
+      sql("CREATE TABLE h2.test.abc USING _ AS SELECT * FROM h2.test.people")
+      val properties = new Properties()
+      val df1 = spark.read.jdbc(url, "h2.test.abc", properties)

Review comment:
       Thanks for taking a look at this. The reason I am doing this is because 
I saw other `DataFrameReader/Writer` APIs have added the support for DataSource 
V2 multiple catalogs, for example, `DataFrameWriter.insertInto` and 
`DataFrameWriter.saveAsTable`, so I thought all the `DataFrameReader/Writer` 
APIs need to support DataSource V2 multiple catalogs as well.

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala
##########
@@ -221,4 +221,21 @@ class JDBCV2Suite extends QueryTest with 
SharedSparkSession {
       checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Row("bob", 4))
     }
   }
+
+  test("DataFrameReader: jdbc") {
+    withTable("h2.test.abc") {
+      sql("CREATE TABLE h2.test.abc USING _ AS SELECT * FROM h2.test.people")
+      val properties = new Properties()
+      val df1 = spark.read.jdbc(url, "h2.test.abc", properties)

Review comment:
       It seems to me that these `jdbc` APIs take Spark table name and probably 
should support multi catalogs as well. Otherwise, we might want to say 
explicitly in the doc that the table names in these APIs can not be multi 
catalogs table names. 
   I will close these two PRs.




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to