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

    https://github.com/apache/spark/pull/16388#discussion_r93832614
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -408,8 +408,8 @@ private[hive] class HiveClientImpl(
             lastAccessTime = h.getLastAccessTime.toLong * 1000,
             storage = CatalogStorageFormat(
               locationUri = shim.getDataLocation(h),
    -          inputFormat = Option(h.getInputFormatClass).map(_.getName),
    -          outputFormat = Option(h.getOutputFormatClass).map(_.getName),
    +          inputFormat = Option(h.getTTable.getSd.getInputFormat),
    +          outputFormat = Option(h.getTTable.getSd.getOutputFormat),
    --- End diff --
    
    After more readings, `getTTable.getSd.getInputFormat` and 
`getTTable.getSd.getOutputFormat` will be null for non-native Hive tables, 
e.g., JDBC tables, HBase tables and Cassandra tables. See the link for more 
details: https://cwiki.apache.org/confluence/display/Hive/StorageHandlers
    
    So far, this is OK. I am just afraid we might expand the usage of 
`getTableOption` in the future. Maybe at least document the restrictions?


---
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