amaliujia commented on code in PR #36586: URL: https://github.com/apache/spark/pull/36586#discussion_r891534128
########## sql/core/src/main/scala/org/apache/spark/sql/catalog/interface.scala: ########## @@ -64,15 +65,34 @@ class Database( @Stable class Table( val name: String, - @Nullable val database: String, + @Nullable val catalog: String, + @Nullable val namespace: Array[String], @Nullable val description: String, val tableType: String, val isTemporary: Boolean) extends DefinedByConstructorParams { + def this(name: String, database: String, description: String, tableType: String, + isTemporary: Boolean) = { + this(name, null, Array(database), description, tableType, isTemporary) + } + + def database: String = { + if (namespace == null) { + null + } else if (namespace.length == 2) { Review Comment: Right I think we only care about array.length = 1 which is the database. ########## sql/core/src/main/scala/org/apache/spark/sql/catalog/interface.scala: ########## @@ -64,15 +65,34 @@ class Database( @Stable class Table( val name: String, - @Nullable val database: String, + @Nullable val catalog: String, + @Nullable val namespace: Array[String], @Nullable val description: String, val tableType: String, val isTemporary: Boolean) extends DefinedByConstructorParams { + def this(name: String, database: String, description: String, tableType: String, + isTemporary: Boolean) = { + this(name, null, Array(database), description, tableType, isTemporary) + } + + def database: String = { + if (namespace == null) { + null + } else if (namespace.length == 2) { Review Comment: Right I think we only care about array.length = 1 which is the database. Will remove it. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org