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



##########
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:
       We need to distinguish between APIs and shortcuts. For 
`DataFrameWriter`, it has 3 APIs: `save`, `insertInto` and `saveAsTable`. 
`parquet`, `json`, `jdbc`, etc. are shortcuts and eventually calls `save()`.
   
   For `insertInto` and `saveAsTable`, they take Spark table name and should 
support multi catalogs. For `save`, it interacts with data source directly with 
options, and thus shouldn't support multi-catalog.
   
   For this particular test, it looks confusing as the registered JDBC catalog 
should already have the url config, why do we need to specify it again in 
`spark.read.jdbc`?




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