You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/05 11:17:18 UTC
[GitHub] [spark] Peng-Lei opened a new pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Peng-Lei opened a new pull request #33219:
URL: https://github.com/apache/spark/pull/33219
### What changes were proposed in this pull request?
When exec the command `SHOW CREATE TABLE` will lost the info null flag if the table column that
is specified `NOT NULL`
### Why are the changes needed?
[SPARK-36012](https://issues.apache.org/jira/browse/SPARK-36012)
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
existed UT test
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665842085
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +183,27 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
}
}
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = sql(s"SHOW CREATE TABLE $t").head().getString(0)
+ .split("\n").map(_.trim)
+ assert(showDDL === Array(
+ "CREATE TABLE `default`.`SPARK_36012` (",
+ "`a` BIGINT NOT NULL,",
+ "`b` BIGINT)",
+ "USING org.apache.spark.sql.sources.SimpleInsertSource"))
Review comment:
I really don't like this function `getShowDDL`. It just returns part of the `DDL` data instead of the complete `DDL` data. But it is named `getShowDDL`
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876617443
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/45322/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] huaxingao commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
huaxingao commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665107266
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +183,27 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
}
}
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = sql(s"SHOW CREATE TABLE $t").head().getString(0)
+ .split("\n").map(_.trim)
+ assert(showDDL === Array(
+ "CREATE TABLE `default`.`SPARK_36012` (",
+ "`a` BIGINT NOT NULL,",
+ "`b` BIGINT)",
+ "USING org.apache.spark.sql.sources.SimpleInsertSource"))
Review comment:
super nit and you don't have to change: I think you can modify `getShowDDL` a bit and reuse it, and make this code structure the same as `test("SPARK-24911: keep quotes for nested fields")`
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876746292
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140811/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876565199
**[Test build #140811 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140811/testReport)** for PR 33219 at commit [`3b57144`](https://github.com/apache/spark/commit/3b5714468bc10c6df3b20225e2db480090c5a6d5).
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665902510
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -176,19 +177,32 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
val createTable = "CREATE TABLE `t1` (`a` STRUCT<`b`: STRING>)"
sql(s"$createTable USING json")
val shownDDL = getShowDDL("SHOW CREATE TABLE t1")
- assert(shownDDL == "CREATE TABLE `default`.`t1` (`a` STRUCT<`b`: STRING>)")
+ assert(shownDDL.mkString(" ") ==
+ "CREATE TABLE `default`.`t1` ( `a` STRUCT<`b`: STRING>) USING json")
checkCreateTable("t1")
}
}
- protected def getShowDDL(showCreateTableSql: String): String = {
- val result = sql(showCreateTableSql)
- .head()
- .getString(0)
- .split("\n")
- .map(_.trim)
- if (result.length > 1) result(0) + result(1) else result.head
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = getShowDDL(s"SHOW CREATE TABLE $t")
+ assert(showDDL.mkString(" ") == s"CREATE TABLE `default`.`$t` ( `a` BIGINT NOT NULL," +
+ s" `b` BIGINT) USING ${classOf[SimpleInsertSource].getName}")
+ }
+ }
+
+ protected def getShowDDL(showCreateTableSql: String): Array[String] = {
+ sql(showCreateTableSql).head().getString(0).split("\n").map(_.trim)
Review comment:
Yeah. In `HiveShowCreateTableSuite` it compare the `Array(0) + Array(1)`. I do not want to include the `USING text TBLPROPERTIES`, because the test fail. I just think `getShowDDL` return Array[String] is flexible, because if we want to use `Array` to assert, it just ok. If we want to use `String` to assert, just `mkString()`. @cloud-fan @huaxingao
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876565199
**[Test build #140811 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140811/testReport)** for PR 33219 at commit [`3b57144`](https://github.com/apache/spark/commit/3b5714468bc10c6df3b20225e2db480090c5a6d5).
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665854845
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -176,19 +177,32 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
val createTable = "CREATE TABLE `t1` (`a` STRUCT<`b`: STRING>)"
sql(s"$createTable USING json")
val shownDDL = getShowDDL("SHOW CREATE TABLE t1")
- assert(shownDDL == "CREATE TABLE `default`.`t1` (`a` STRUCT<`b`: STRING>)")
+ assert(shownDDL.mkString(" ") ==
+ "CREATE TABLE `default`.`t1` ( `a` STRUCT<`b`: STRING>) USING json")
checkCreateTable("t1")
}
}
- protected def getShowDDL(showCreateTableSql: String): String = {
- val result = sql(showCreateTableSql)
- .head()
- .getString(0)
- .split("\n")
- .map(_.trim)
- if (result.length > 1) result(0) + result(1) else result.head
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = getShowDDL(s"SHOW CREATE TABLE $t")
+ assert(showDDL.mkString(" ") == s"CREATE TABLE `default`.`$t` ( `a` BIGINT NOT NULL," +
+ s" `b` BIGINT) USING ${classOf[SimpleInsertSource].getName}")
+ }
+ }
+
+ protected def getShowDDL(showCreateTableSql: String): Array[String] = {
+ sql(showCreateTableSql).head().getString(0).split("\n").map(_.trim)
Review comment:
why can't we always call `.mkString(" ")` here?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876639922
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45322/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r664738897
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala
##########
@@ -654,7 +654,7 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession {
Row(Row(3, 4, null), 0) :: Row(Row(1, 2, null), 1) :: Row(Row(2, 3, null), 2) :: Nil
)
- assert(unionDf.schema.toDDL == "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT>,`idx` INT")
+ assert(unionDf.schema.toDDL == "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT>,`idx` INT NOT NULL")
Review comment:
since we are touching the code here, can we change it to compare the `StructType` instance instead of the DDL 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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan closed pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #33219:
URL: https://github.com/apache/spark/pull/33219
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876595783
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/45322/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876611866
thanks, merging to master/3.2 (since v2 SHOW CREATE TABLE is new in 3.2)
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876726948
**[Test build #140811 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140811/testReport)** for PR 33219 at commit [`3b57144`](https://github.com/apache/spark/commit/3b5714468bc10c6df3b20225e2db480090c5a6d5).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876639922
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45322/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-874053729
Can one of the admins verify this patch?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-874053729
Can one of the admins verify this patch?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-874497006
@cloud-fan Could you take a look?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r664739741
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +182,27 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
}
}
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING org.apache.spark.sql.sources.SimpleInsertSource
Review comment:
nit: `classOf[SimpleInsertSource].getName`
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876746292
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140811/
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665142057
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +183,27 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
}
}
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = sql(s"SHOW CREATE TABLE $t").head().getString(0)
+ .split("\n").map(_.trim)
+ assert(showDDL === Array(
+ "CREATE TABLE `default`.`SPARK_36012` (",
+ "`a` BIGINT NOT NULL,",
+ "`b` BIGINT)",
+ "USING org.apache.spark.sql.sources.SimpleInsertSource"))
Review comment:
@huaxingao Thank you for your code review. By the way, change it.
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -182,6 +183,27 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
}
}
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = sql(s"SHOW CREATE TABLE $t").head().getString(0)
+ .split("\n").map(_.trim)
+ assert(showDDL === Array(
+ "CREATE TABLE `default`.`SPARK_36012` (",
+ "`a` BIGINT NOT NULL,",
+ "`b` BIGINT)",
+ "USING org.apache.spark.sql.sources.SimpleInsertSource"))
Review comment:
@huaxingao Thank you for your code review. done.
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] cloud-fan commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r664738963
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala
##########
@@ -670,7 +670,7 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession {
Row(Row(120, 121, 122, 123), 2) :: Nil // df3
)
assert(unionDf.schema.toDDL ==
Review comment:
ditto
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-874497006
@cloud-fan Could you take a look?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] Peng-Lei commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
Peng-Lei commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665005082
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala
##########
@@ -654,7 +654,7 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession {
Row(Row(3, 4, null), 0) :: Row(Row(1, 2, null), 1) :: Row(Row(2, 3, null), 2) :: Nil
)
- assert(unionDf.schema.toDDL == "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT>,`idx` INT")
+ assert(unionDf.schema.toDDL == "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT>,`idx` INT NOT NULL")
Review comment:
sure
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] huaxingao commented on pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
huaxingao commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-876559581
ok to test
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] huaxingao commented on a change in pull request #33219: [SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE
Posted by GitBox <gi...@apache.org>.
huaxingao commented on a change in pull request #33219:
URL: https://github.com/apache/spark/pull/33219#discussion_r665891323
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala
##########
@@ -176,19 +177,32 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils {
val createTable = "CREATE TABLE `t1` (`a` STRUCT<`b`: STRING>)"
sql(s"$createTable USING json")
val shownDDL = getShowDDL("SHOW CREATE TABLE t1")
- assert(shownDDL == "CREATE TABLE `default`.`t1` (`a` STRUCT<`b`: STRING>)")
+ assert(shownDDL.mkString(" ") ==
+ "CREATE TABLE `default`.`t1` ( `a` STRUCT<`b`: STRING>) USING json")
checkCreateTable("t1")
}
}
- protected def getShowDDL(showCreateTableSql: String): String = {
- val result = sql(showCreateTableSql)
- .head()
- .getString(0)
- .split("\n")
- .map(_.trim)
- if (result.length > 1) result(0) + result(1) else result.head
+ test("SPARK-36012: Add NULL flag when SHOW CREATE TABLE") {
+ val t = "SPARK_36012"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint NOT NULL,
+ | b bigint
+ |)
+ |USING ${classOf[SimpleInsertSource].getName}
+ """.stripMargin)
+ val showDDL = getShowDDL(s"SHOW CREATE TABLE $t")
+ assert(showDDL.mkString(" ") == s"CREATE TABLE `default`.`$t` ( `a` BIGINT NOT NULL," +
+ s" `b` BIGINT) USING ${classOf[SimpleInsertSource].getName}")
+ }
+ }
+
+ protected def getShowDDL(showCreateTableSql: String): Array[String] = {
+ sql(showCreateTableSql).head().getString(0).split("\n").map(_.trim)
Review comment:
I think @Peng-Lei doesn't want to include the `USING text TBLPROPERTIES ( 'transient_lastDdlTime...` in the test in `HiveShowCreateTableSuite`. I guess maybe always call `.mkString(" ")` here and trim off the `USING text ...` using something like `shownDDL.substring(0, shownDDL.indexOf(" USING")` in the Hive test?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33219: [SPARK-36012][SQL] Add null flag when SHOW CREATE TABLE in v2
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33219:
URL: https://github.com/apache/spark/pull/33219#issuecomment-874053729
Can one of the admins verify this patch?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org