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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/V1Table.scala:
##########
@@ -109,6 +109,45 @@ private[sql] object V1Table {
       case _ => None
     }
   }
+
+  def toCatalogTable(
+      catalog: CatalogPlugin,
+      ident: Identifier,
+      t: MetadataOnlyTable): CatalogTable = {
+    val tableType = t.getTableType() match {
+      case TableSummary.VIEW_TABLE_TYPE => CatalogTableType.VIEW
+      case TableSummary.MANAGED_TABLE_TYPE => CatalogTableType.MANAGED
+      case _ => CatalogTableType.EXTERNAL
+    }
+    val viewText = Option(t.getViewText())
+    val tableProps = t.getTableProps().asScala.toMap
+    val (partCols, bucketSpec, clusterBySpec) = 
t.partitioning().toSeq.convertTransforms
+    CatalogTable(
+      identifier = TableIdentifier(
+        table = ident.name(),
+        database = Some(ident.namespace().lastOption.getOrElse("root")),
+        catalog = Some(catalog.name())),
+      tableType = tableType,
+      storage = CatalogStorageFormat.empty.copy(

Review Comment:
   `V1Table` itself does not access the input/output format when translating v1 
table to v2 table. I think Hive table is never supported by DS v2 and we will 
not handle it here.



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