cloud-fan commented on a change in pull request #35131:
URL: https://github.com/apache/spark/pull/35131#discussion_r781151045
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/catalog/V1Table.scala
##########
@@ -82,6 +84,21 @@ private[sql] case class V1Table(v1Table: CatalogTable)
extends Table {
override def toString: String = s"V1Table($name)"
}
+private[sql] object V1Table {
+ def addV2TableProperties(v1Table: CatalogTable): Map[String, String] = {
+ val external = v1Table.tableType == CatalogTableType.EXTERNAL
+
+ v1Table.properties ++
+ v1Table.storage.properties.map { case (key, value) =>
+ TableCatalog.OPTION_PREFIX + key -> value } ++
+ v1Table.provider.map(TableCatalog.PROP_PROVIDER -> _) ++
+ v1Table.comment.map(TableCatalog.PROP_COMMENT -> _) ++
+ v1Table.storage.locationUri.map(TableCatalog.PROP_LOCATION ->
_.toString) ++
+ (if (external) Some(TableCatalog.PROP_EXTERNAL -> "true") else None) ++
+ Map(TableCatalog.PROP_OWNER -> Utils.getCurrentUserName())
Review comment:
```suggestion
Map(TableCatalog.PROP_OWNER -> v1Table.owner)
```
--
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]