Github user ericl commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14750#discussion_r86639395
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala ---
    @@ -475,18 +503,51 @@ private[spark] class HiveExternalCatalog(conf: 
SparkConf, hadoopConf: Configurat
           tableDefinition
         }
     
    -    if (DDLUtils.isDatasourceTable(withStatsProps)) {
    -      val oldTableDef = client.getTable(db, 
withStatsProps.identifier.table)
    +    if (tableDefinition.tableType == VIEW) {
    +      client.alterTable(withStatsProps)
    +    } else {
    +      val oldTableDef = getRawTable(db, withStatsProps.identifier.table)
     
    -      val oldLocation = getLocationFromStorageProps(oldTableDef)
    -      val newLocation = tableDefinition.storage.locationUri
    -      // Only update the `locationUri` field if the location is really 
changed, because this table
    -      // may be not Hive-compatible and can not set the `locationUri` 
field. We should respect the
    -      // old `locationUri` even it's None.
    -      val storageWithNewLocation = if (oldLocation == newLocation) {
    -        oldTableDef.storage
    +      val newStorage = if (tableDefinition.provider.get == "hive") {
    --- End diff --
    
    Also compare against constant?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to