-
- Downloads
[SPARK-20198][SQL] Remove the inconsistency in table/function name conventions...
[SPARK-20198][SQL] Remove the inconsistency in table/function name conventions in SparkSession.Catalog APIs ### What changes were proposed in this pull request? Observed by felixcheung , in `SparkSession`.`Catalog` APIs, we have different conventions/rules for table/function identifiers/names. Most APIs accept the qualified name (i.e., `databaseName`.`tableName` or `databaseName`.`functionName`). However, the following five APIs do not accept it. - def listColumns(tableName: String): Dataset[Column] - def getTable(tableName: String): Table - def getFunction(functionName: String): Function - def tableExists(tableName: String): Boolean - def functionExists(functionName: String): Boolean To make them consistent with the other Catalog APIs, this PR does the changes, updates the function/API comments and adds the `params` to clarify the inputs we allow. ### How was this patch tested? Added the test cases . Author: Xiao Li <gatorsmile@gmail.com> Closes #17518 from gatorsmile/tableIdentifier.
Showing
- sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 8 additions, 0 deletions...in/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala 13 additions, 0 deletions...ala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParseDriver.scala 6 additions, 1 deletion...la/org/apache/spark/sql/catalyst/parser/ParseDriver.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserInterface.scala 4 additions, 1 deletion...rg/apache/spark/sql/catalyst/parser/ParserInterface.scala
- sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala 6 additions, 1 deletion...re/src/main/scala/org/apache/spark/sql/SparkSession.scala
- sql/core/src/main/scala/org/apache/spark/sql/catalog/Catalog.scala 90 additions, 19 deletions...src/main/scala/org/apache/spark/sql/catalog/Catalog.scala
- sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala 38 additions, 35 deletions...ain/scala/org/apache/spark/sql/internal/CatalogImpl.scala
- sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala 21 additions, 0 deletions...st/scala/org/apache/spark/sql/internal/CatalogSuite.scala
Loading
Please register or sign in to comment