Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17783

Hide Credentials in CREATE and DESC FORMATTED/EXTENDED a PERSISTENT/TEMP Table for JDBC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0.1, 2.1.0
    • 2.0.3, 2.1.0
    • SQL
    • None

    Description

      We should never expose the Credentials in the EXPLAIN and DESC FORMATTED/EXTENDED command. However, below commands exposed the credentials.

      CREATE TABLE tab1 USING org.apache.spark.sql.jdbc
      
      == Physical Plan ==
      ExecutedCommand
         +- CreateDataSourceTableCommand CatalogTable(
      	Table: `tab1`
      	Created: Tue Oct 04 21:39:44 PDT 2016
      	Last Access: Wed Dec 31 15:59:59 PST 1969
      	Type: MANAGED
      	Provider: org.apache.spark.sql.jdbc
      	Storage(Properties: [url=jdbc:h2:mem:testdb0;user=testUser;password=testPass, dbtable=TEST.PEOPLE, user=testUser, password=testPass])), false
      
      DESC FORMATTED tab1
      
      ...
      |# Storage Information       |                                                                  |       |
      |Compressed:                 |No                                                                |       |
      |Storage Desc Parameters:    |                                                                  |       |
      |  path                      |file:/Users/xiaoli/IdeaProjects/sparkDelivery/spark-warehouse/tab1|       |
      |  url                       |jdbc:h2:mem:testdb0;user=testUser;password=testPass               |       |
      |  dbtable                   |TEST.PEOPLE                                                       |       |
      |  user                      |testUser                                                          |       |
      |  password                  |testPass                                                          |       |
      +----------------------------+------------------------------------------------------------------+-------+
      
      DESC EXTENDED tab1
      
      ...
      	Storage(Properties: [path=file:/Users/xiaoli/IdeaProjects/sparkDelivery/spark-warehouse/tab1, url=jdbc:h2:mem:testdb0;user=testUser;password=testPass, dbtable=TEST.PEOPLE, user=testUser, password=testPass]))|       |
      
      CREATE TEMP VIEW tab1 USING org.apache.spark.sql.jdbc
      
      == Physical Plan ==
      ExecutedCommand
         +- CreateTempViewUsing `tab1`, false, org.apache.spark.sql.jdbc, Map(url -> jdbc:h2:mem:testdb0;user=testUser;password=testPass, dbtable -> TEST.PEOPLE, user -> testUser, password -> testPass)
      

      Attachments

        Issue Links

          Activity

            People

              smilegator Xiao Li
              smilegator Xiao Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: