You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/10 09:02:06 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request, #36495: [SPARK-39136][SQL] JDBCTable support table properties

AngersZhuuuu opened a new pull request, #36495:
URL: https://github.com/apache/spark/pull/36495

   
   ### What changes were proposed in this pull request?
   Currently, when call `DESC EXTENDED` at an JDBCTable, there is no table properties, user don't know the related url information.
   ```
   > desc formatted jdbc.test.people;
   NAME	string
   ID	int
   
   # Partitioning
   Not partitioned
   
   # Detailed Table Information
   Name	test.people
   Table Properties	[]
   Time taken: 0.048 seconds, Fetched 9 row(s)
   ``` 
   
   After this pr:
   ```
   +----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
   |                    col_name|                                                                                                                                                                                                                                      data_type|comment|
   +----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
   |                        DEPT|                                                                                                                                                                                                                                            int|       |
   |                        NAME|                                                                                                                                                                                                                                         string|       |
   |                      SALARY|                                                                                                                                                                                                                                  decimal(20,2)|       |
   |                       BONUS|                                                                                                                                                                                                                                         double|       |
   |                  IS_MANAGER|                                                                                                                                                                                                                                        boolean|       |
   |                            |                                                                                                                                                                                                                                               |       |
   |              # Partitioning|                                                                                                                                                                                                                                               |       |
   |             Not partitioned|                                                                                                                                                                                                                                               |       |
   |                            |                                                                                                                                                                                                                                               |       |
   |# Detailed Table Information|                                                                                                                                                                                                                                               |       |
   |                        Name|                                                                                                                                                                                                                                  test.employee|       |
   |            Table Properties|[dbtable="test"."employee",driver=org.h2.Driver,pushDownAggregate=true,pushDownLimit=true,url=jdbc:h2:/Users/yi.zhu/Documents/project/Angerszhuuuu/spark/target/tmp/spark-f6094e60-b18a-4591-afb5-c284f1700304;user=testUser;password=testPass]|       |
   +----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------+
   ```
   
   
   ### Why are the changes needed?
   When desc JDBCTable, make it can show JDBCOptions as table properties. Make user easy to check 
   
   
   ### Does this PR introduce _any_ user-facing change?
   User can use DESC EXTENDED to know JDBCTable's JDBCOptions
   
   
   ### How was this patch tested?
   Added UT


-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] beliefer commented on pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
beliefer commented on PR #36495:
URL: https://github.com/apache/spark/pull/36495#issuecomment-1122249012

   Display table properties looks good.
   But user and password seems need encryption or use asterisk substitution.


-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] cloud-fan commented on a diff in pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36495:
URL: https://github.com/apache/spark/pull/36495#discussion_r869132330


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTable.scala:
##########
@@ -40,6 +40,8 @@ case class JDBCTable(ident: Identifier, schema: StructType, jdbcOptions: JDBCOpt
     util.EnumSet.of(BATCH_READ, V1_BATCH_WRITE, TRUNCATE)
   }
 
+  override def properties(): util.Map[String, String] = jdbcOptions.parameters.toMap.asJava

Review Comment:
   we need to define what are the table properties of a JDBC table. Ideally it should only be the properties users put in  `CREATE TABLE ... TBLPROPERTIES`



-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] github-actions[bot] closed pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties
URL: https://github.com/apache/spark/pull/36495


-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] github-actions[bot] commented on pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #36495:
URL: https://github.com/apache/spark/pull/36495#issuecomment-1254360757

   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] AngersZhuuuu commented on a diff in pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on code in PR #36495:
URL: https://github.com/apache/spark/pull/36495#discussion_r881256239


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTable.scala:
##########
@@ -40,6 +40,8 @@ case class JDBCTable(ident: Identifier, schema: StructType, jdbcOptions: JDBCOpt
     util.EnumSet.of(BATCH_READ, V1_BATCH_WRITE, TRUNCATE)
   }
 
+  override def properties(): util.Map[String, String] = jdbcOptions.parameters.toMap.asJava

Review Comment:
   Oh, so we need to support all dialect for different jdbc driver.



-- 
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-unsubscribe@spark.apache.org

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


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


[GitHub] [spark] AngersZhuuuu commented on pull request #36495: [SPARK-39136][SQL] JDBCTable support table properties

Posted by GitBox <gi...@apache.org>.
AngersZhuuuu commented on PR #36495:
URL: https://github.com/apache/spark/pull/36495#issuecomment-1122123946

   @beliefer @cloud-fan 


-- 
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-unsubscribe@spark.apache.org

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


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