pan3793 commented on PR #7775:
URL: https://github.com/apache/kyuubi/pull/7775#issuecomment-6165868021

   Match on the public `org.apache.spark.sql.connector.catalog.Table` type 
instead of the `V1Table` class name, so this handles connector tables generally:
   
   ```scala
   import org.apache.spark.sql.connector.catalog.{Identifier, Table => V2Table}
   
   val maybeTable = v match {
     case table: V2Table => table
     case _ => invokeAs[AnyRef](v, "table")
   }
   ```
   
   For example, Delta Lake\s 
[`DeltaCatalog.loadTable`](https://github.com/delta-io/delta/blob/v3.3.1/spark/src/main/scala/org/apache/spark/sql/delta/catalog/DeltaCatalog.scala#L226)
 returns a `DeltaTableV2`, which exposes the owner through 
[`properties()`](https://github.com/delta-io/delta/blob/v3.3.1/spark/src/main/scala/org/apache/spark/sql/delta/catalog/DeltaTableV2.scala#L203)
 but has no `table` accessor. The fallback preserves unwrapping for 
`ResolvedTable` and `DataSourceV2Relation`.


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