beliefer commented on issue #23574: [SPARK-26643][SQL] Fix incorrect analysis 
exception about set table properties.
URL: https://github.com/apache/spark/pull/23574#issuecomment-456350233
 
 
   @gatorsmile Hi
   I check the grammar of 'alter table', it will save some table properties key 
start with `sql`.
   Although hive table will contains these properties like 
`spark.sql.sources.schema.part.0` and `spark.sql.sources.schema.numParts` and 
so on, the method `HiveExternalCatalog.getTable` will call another method 
`restoreTableMetadata` after read metadata from hive.
   `  override def getTable(db: String, table: String): CatalogTable = 
withClient {
       restoreTableMetadata(getRawTable(db, table))
     }`
   The method `restoreTableMetadata` will filter table properties key start 
with `sql`.
   `    // Get the original table properties as defined by the user.
       table.copy(
         createVersion = version,
         properties = table.properties.filterNot { case (key, _) => 
key.startsWith(SPARK_SQL_PREFIX) })`
   So spark is correct.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to