[GitHub] [spark] cloud-fan commented on a change in pull request #34686: [SPARK-37444][SQL] ALTER NAMESPACE ... SET LOCATION should handle empty location consistently across v1 and v2 command
cloud-fan commented on a change in pull request #34686: URL: https://github.com/apache/spark/pull/34686#discussion_r755791057 ## File path: sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala ## @@ -1294,13 +1294,25 @@ class DataSourceV2SQLSuite assert(descriptionDf.collect() === Seq( Row("Namespace Name", "ns2"), Row(SupportsNamespaces.PROP_COMMENT.capitalize, "test namespace"), -Row(SupportsNamespaces.PROP_LOCATION.capitalize, "/tmp/ns_test_2"), +Row(SupportsNamespaces.PROP_LOCATION.capitalize, "file:/tmp/ns_test_2"), Row(SupportsNamespaces.PROP_OWNER.capitalize, defaultUser), Row("Properties", "")) ) } } + test("SPARK-37444: ALTER NAMESPACE .. SET LOCATION using v2 catalog with empty location") { +val ns = "testcat.ns1.ns2" +withNamespace(ns) { + sql(s"CREATE NAMESPACE IF NOT EXISTS $ns COMMENT " + +"'test namespace' LOCATION '/tmp/ns_test_1'") Review comment: shall we do the same thing for CREATE NAMESPACE? We can do it in a separated PR. -- 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
[GitHub] [spark] cloud-fan commented on a change in pull request #34686: [SPARK-37444][SQL] ALTER NAMESPACE ... SET LOCATION should handle empty location consistently across v1 and v2 command
cloud-fan commented on a change in pull request #34686: URL: https://github.com/apache/spark/pull/34686#discussion_r755790090 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala ## @@ -44,7 +45,8 @@ import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.storage.StorageLevel import org.apache.spark.unsafe.types.UTF8String -class DataSourceV2Strategy(session: SparkSession) extends Strategy with PredicateHelper { +class DataSourceV2Strategy(session: SparkSession) extends Strategy +with PredicateHelper with SQLConfHelper { Review comment: We don't need `SQLConfHelper`. We can get the conf by `session.sessionState.conf` -- 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
[GitHub] [spark] cloud-fan commented on a change in pull request #34686: [SPARK-37444][SQL] ALTER NAMESPACE ... SET LOCATION should handle empty location consistently across v1 and v2 command
cloud-fan commented on a change in pull request #34686: URL: https://github.com/apache/spark/pull/34686#discussion_r754984133 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala ## @@ -349,7 +351,7 @@ case class SetNamespaceProperties( */ case class SetNamespaceLocation( namespace: LogicalPlan, -location: String) extends UnaryCommand { +location: URI) extends UnaryCommand { Review comment: and can you refer to the code for qualifying the path string in v1 commands? Let's make sure v1 and v2 are truly consistent. -- 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
[GitHub] [spark] cloud-fan commented on a change in pull request #34686: [SPARK-37444][SQL] ALTER NAMESPACE ... SET LOCATION should handle empty location consistently across v1 and v2 command
cloud-fan commented on a change in pull request #34686: URL: https://github.com/apache/spark/pull/34686#discussion_r754983417 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala ## @@ -349,7 +351,7 @@ case class SetNamespaceProperties( */ case class SetNamespaceLocation( namespace: LogicalPlan, -location: String) extends UnaryCommand { +location: URI) extends UnaryCommand { Review comment: it's a bit weird to have `URI` in the logical plan, can we keep it as `String` type and just put the qualified path string? -- 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