HyukjinKwon commented on a change in pull request #26923: [SPARK-30284][SQL]
CREATE VIEW should keep the current catalog and namespace
URL: https://github.com/apache/spark/pull/26923#discussion_r362368398
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala
##########
@@ -368,7 +388,27 @@ case class CatalogTable(
}
object CatalogTable {
+ // Starting from Spark 3.0, we don't use this property any more.
`VIEW_CATALOG_AND_NAMESPACE` is
+ // used instead.
val VIEW_DEFAULT_DATABASE = "view.default.database"
+
+ val VIEW_CATALOG_AND_NAMESPACE = "view.catalogAndNamespace.numParts"
+ val VIEW_CATALOG_AND_NAMESPACE_PART_PREFIX = "view.catalogAndNamespace.part."
+ // Convert the current catalog and namespace to properties.
+ def catalogAndNamespaceToProps(
+ currentCatalog: String,
+ currentNamespace: Seq[String]): Map[String, String] = {
+ val props = new mutable.HashMap[String, String]
+ val parts = currentCatalog +: currentNamespace
+ if (parts.nonEmpty) {
Review comment:
Hm, I wonder why we started to use this way (e.g., in
`VIEW_QUERY_OUTPUT_COLUMN_NAME_PREFIX`). It's not performance sensitive code
path and it needs a manual (de)encoding anyway. I could do it with JSON array
which can be done a couple of lines (except imports), which has a better
readability. It's fine as is considering that this is already what we do ...
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]