uros-b commented on code in PR #56606:
URL: https://github.com/apache/spark/pull/56606#discussion_r3442205621
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/V1Table.scala:
##########
@@ -113,9 +113,9 @@ private[sql] object V1Table {
def toCatalogTable(
catalog: CatalogPlugin,
ident: Identifier,
- t: MetadataTable): CatalogTable = t.getTableInfo match {
+ t: MetadataTable): CatalogTable = t.getRelationInfo match {
case viewInfo: ViewInfo => toCatalogTable(catalog, ident, viewInfo)
- case tableInfo => toCatalogTable(catalog, ident, tableInfo)
+ case tableInfo: TableInfo => toCatalogTable(catalog, ident, tableInfo)
Review Comment:
Here we could potentially get a `MatchError` rather than degrade gracefully
if a third RelationInfo subclass is ever added. Acceptable given the
sealed-in-practice hierarchy. A default arm or a comment noting the assumption
would be slightly more future-proof.
--
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]