[GitHub] [spark] LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] Create table like should keep tracksPartitionsInCatalog same with source table

2020-02-18 Thread GitBox
LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] 
Create table like should keep tracksPartitionsInCatalog same with source table
URL: https://github.com/apache/spark/pull/27538#discussion_r380666061
 
 

 ##
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 ##
 @@ -2724,4 +2730,19 @@ class HiveDDLSuite
   }
 }
   }
+
+  test("SPARK-30785: create table like a partitioned table") {
+val catalog = spark.sessionState.catalog
+withTable("sc_part", "ta_part") {
+  sql("CREATE TABLE sc_part (key string, ts int) USING parquet PARTITIONED 
BY (ts)")
+  sql("CREATE TABLE ta_part like sc_part")
+  val sourceTable = catalog.getTableMetadata(TableIdentifier("sc_part", 
Some("default")))
+  val targetTable = catalog.getTableMetadata(TableIdentifier("ta_part", 
Some("default")))
+  assert(sourceTable.tracksPartitionsInCatalog)
+  assert(sourceTable.tracksPartitionsInCatalog == 
targetTable.tracksPartitionsInCatalog)
 
 Review comment:
   fixed


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] LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] Create table like should keep tracksPartitionsInCatalog same with source table

2020-02-14 Thread GitBox
LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] 
Create table like should keep tracksPartitionsInCatalog same with source table
URL: https://github.com/apache/spark/pull/27538#discussion_r379709331
 
 

 ##
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 ##
 @@ -2724,4 +2730,19 @@ class HiveDDLSuite
   }
 }
   }
+
+  test("SPARK-30785: create table like a partitioned table") {
 
 Review comment:
   This issue only exists in DS partitioned 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] LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] Create table like should keep tracksPartitionsInCatalog same with source table

2020-02-14 Thread GitBox
LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] 
Create table like should keep tracksPartitionsInCatalog same with source table
URL: https://github.com/apache/spark/pull/27538#discussion_r379709202
 
 

 ##
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 ##
 @@ -2724,4 +2730,19 @@ class HiveDDLSuite
   }
 }
   }
+
+  test("SPARK-30785: create table like a partitioned table") {
 
 Review comment:
   Check the PR description. 


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] LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] Create table like should keep tracksPartitionsInCatalog same with source table

2020-02-14 Thread GitBox
LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] 
Create table like should keep tracksPartitionsInCatalog same with source table
URL: https://github.com/apache/spark/pull/27538#discussion_r379708949
 
 

 ##
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 ##
 @@ -2724,4 +2730,19 @@ class HiveDDLSuite
   }
 }
   }
+
+  test("SPARK-30785: create table like a partitioned table") {
 
 Review comment:
   Correct, the test fails without 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.
 
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] LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] Create table like should keep tracksPartitionsInCatalog same with source table

2020-02-12 Thread GitBox
LantaoJin commented on a change in pull request #27538: [SPARK-30785][SQL] 
Create table like should keep tracksPartitionsInCatalog same with source table
URL: https://github.com/apache/spark/pull/27538#discussion_r378634569
 
 

 ##
 File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
 ##
 @@ -2724,4 +2730,18 @@ class HiveDDLSuite
   }
 }
   }
+
+  test("SPARK-30785: create table like a partitioned table") {
+val catalog = spark.sessionState.catalog
+withTable("sc_part", "ta_part") {
+  sql("CREATE TABLE sc_part (key string, ts int) USING parquet PARTITIONED 
BY (ts)")
+  sql("CREATE TABLE ta_part like sc_part")
+  val sourceTable = catalog.getTableMetadata(TableIdentifier("sc_part", 
Some("default")))
+  val targetTable = catalog.getTableMetadata(TableIdentifier("ta_part", 
Some("default")))
+  assert(sourceTable.tracksPartitionsInCatalog)
+  assert(sourceTable.tracksPartitionsInCatalog == 
targetTable.tracksPartitionsInCatalog)
+  assert(targetTable.partitionColumnNames == Seq("ts"))
+  sql("ALTER TABLE ta_part ADD PARTITION (ts=10)") // no exception
+}
 
 Review comment:
   Sure. I think you mean `SHOW PARTITIONS ta_part`


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