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

    https://github.com/apache/spark/pull/18824#discussion_r131059637
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -413,7 +414,10 @@ private[hive] class HiveClientImpl(
             unsupportedFeatures += "partitioned view"
           }
     
    -      val properties = Option(h.getParameters).map(_.asScala.toMap).orNull
    +      val properties = 
Option(h.getParameters).map(_.asScala.toMap).getOrElse(Map())
    +
    +      val provider = 
properties.get(HiveExternalCatalog.DATASOURCE_PROVIDER)
    +        .orElse(Some(DDLUtils.HIVE_PROVIDER))
    --- End diff --
    
    Oh. Nvm. Looks like we access the key `DATASOURCE_PROVIDER` in 
`table.properties` for that purpose. This should be safe. Anyway, actually we 
will set `provider` for `CatalogTable` later when restoring the table read from 
metastore.
    
    Another concern is we previously don't restore `provider` for a view, 
please refer to 
https://github.com/apache/spark/blob/f18b905f6cace7686ef169fda7de474079d0af23/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala#L682.
 By this change, we will set `provider` to `HIVE_PROVIDER` too for view.
    



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to