[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r362698055 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -862,6 +879,13 @@ class Analyzer( } case u: UnresolvedRelation => resolveRelation(u) + + case u @ UnresolvedTable(SessionCatalogAndIdentifier(catalog, ident)) => Review comment: This needs to go thru `lookupRelation` as suggested, no? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r362070796 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -732,6 +742,11 @@ class Analyzer( lookupTempView(ident) .map(view => i.copy(table = view)) .getOrElse(i) + case u @ UnresolvedTable(ident) => +lookupTempView(ident).foreach { _ => + u.failAnalysis(s"${ident.quoted} is a view not table.") Review comment: Shouldn't this be `is a temp view not table`? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r362076431 ## File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala ## @@ -1929,6 +1929,71 @@ class DataSourceV2SQLSuite } } + test("COMMENT ON NAMESPACE") { +// unset this config to use the default v2 session catalog. +spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) +// Session catalog is used. +sql(s"CREATE NAMESPACE ns") Review comment: `s` is not needed. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r361772691 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -720,6 +722,14 @@ class Analyzer( } } + case class ResolveNamespace(catalogManager: CatalogManager) +extends Rule[LogicalPlan] with LookupCatalog { +def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators { + case UnresolvedNamespace(CatalogAndNamespace(catalog, ns)) => +ResolvedNamespace(catalog.asNamespaceCatalog, ns) Review comment: I have a question. We have the following in `ResolveSessionCatalog.scala`: ```scala case ShowTablesStatement(Some(CatalogAndNamespace(catalog, ns)), pattern) if isSessionCatalog(catalog) => ``` Do we plan to add these statements here and not resolve `UnresolvedNamespace` and let `ResolveSessionCatalog` handle them? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r361773790 ## File path: sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 ## @@ -212,6 +212,9 @@ statement | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? multipartIdentifier partitionSpec? describeColName? #describeTable | (DESC | DESCRIBE) QUERY? query #describeQuery +| COMMENT ON (database | NAMESPACE) multipartIdentifier IS Review comment: I created https://github.com/apache/spark/pull/27027 for this. 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands
imback82 commented on a change in pull request #26847: [SPARK-30214][SQL] A new framework to resolve v2 commands URL: https://github.com/apache/spark/pull/26847#discussion_r361772691 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -720,6 +722,14 @@ class Analyzer( } } + case class ResolveNamespace(catalogManager: CatalogManager) +extends Rule[LogicalPlan] with LookupCatalog { +def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators { + case UnresolvedNamespace(CatalogAndNamespace(catalog, ns)) => +ResolvedNamespace(catalog.asNamespaceCatalog, ns) Review comment: I have a question. We have the following in `ResolveSessionCatalog.scala`: ```scala case ShowTablesStatement(Some(CatalogAndNamespace(catalog, ns)), pattern) if isSessionCatalog(catalog) => ``` Do we plan to add these statements here and not resolve `UnresolvedNamespace` and let `ResolveSessionCatalog` handle them? 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: us...@infra.apache.org With regards, Apache Git Services - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org