Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16388#discussion_r93921312
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
---
@@ -408,8 +408,15 @@ 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),
+ // To avoid ClassNotFound exception, we try our best to not get
the format class, but get
+ // the class name directly. However, for non-native tables,
there is no interface to get
+ // the format class name, so we may still throw ClassNotFound in
this case.
+ inputFormat = Option(h.getTTable.getSd.getInputFormat).orElse {
+ Option(h.getStorageHandler).map(_.getInputFormatClass.getName)
--- End diff --
no it's not a bug, `getInputFormatClass` will look for storage handler.
---
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]