cloud-fan commented on code in PR #36027:
URL: https://github.com/apache/spark/pull/36027#discussion_r977795842


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala:
##########
@@ -435,6 +439,14 @@ private[hive] class HiveClientImpl(
     getRawTableOption(dbName, tableName).map(convertHiveTableToCatalogTable)
   }
 
+  override def getCatalogAndHiveTableOption(
+      dbName: String,
+      tableName: String): Option[CatalogAndHiveTable] = withHiveState {
+    logDebug(s"Looking up $dbName.$tableName")
+    getRawTableOption(dbName, tableName)
+      .map(t => new CatalogAndHiveTableImpl(convertHiveTableToCatalogTable(t), 
t))

Review Comment:
   I think this is still sub-optimal. Sometimes we just need the raw hive table 
and this has an extra `convertHiveTableToCatalogTable` invocation. How about we 
make it lazy?
   ```
   class RawHiveTable(val rawTable: Object) {
     def toSparkTable: CatalogTable = ...
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to