spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] dongjoon-hyun commented on a change in pull request #27897: [SPARK-31113][SQL] Add SHOW VIEWS command
Date Tue, 17 Mar 2020 19:27:50 GMT
dongjoon-hyun commented on a change in pull request #27897: [SPARK-31113][SQL] Add SHOW VIEWS
command
URL: https://github.com/apache/spark/pull/27897#discussion_r393918282
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ##########
 @@ -880,6 +880,26 @@ class SessionCatalog(
     }
   }
 
+  /**
+   * List all matching views in the specified database, including global/local temporary
views.
+   */
+  def listViews(db: String, pattern: String): Seq[TableIdentifier] = {
+    val dbName = formatDatabaseName(db)
+    val dbViews = if (dbName != globalTempViewManager.database) {
+      requireDbExists(dbName)
+      externalCatalog.listViews(dbName, pattern).map { name =>
+        TableIdentifier(name, Some(dbName))
+      }
+    } else {
+      Nil
+    }
+    // Always get global/local temp views
 
 Review comment:
   Since this is also based on pattern, we don't get result 'Always'.
   `Always get` -> `Always try to get` or we can remove this comment.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message