You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2023/05/11 12:50:23 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #41113: [SPARK-43400][SQL] Add Primary Key syntax support

LuciferYang commented on code in PR #41113:
URL: https://github.com/apache/spark/pull/41113#discussion_r1191135180


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala:
##########
@@ -2195,6 +2195,17 @@ abstract class DDLSuite extends QueryTest with DDLSuiteBase {
         "operation" -> "generated columns")
     )
   }
+
+  test("SPARK-43400: Add Primary Key syntax support") {
+    val catalog = spark.sessionState.catalog
+    sql("CREATE TABLE s(a INT, b INT, PRIMARY KEY(a)) USING parquet")
+    var source = catalog.getTableMetadata(TableIdentifier("s"))
+    assert(source.provider == Some("parquet"))
+
+    sql("CREATE TABLE t(a INT PRIMARY KEY, b INT) USING orc")

Review Comment:
   For File table like parquet, how to ensure the primary key is unique and not null?
   Will it support combined primary keys?
   Will there be a design doc to encourage more people to participate in the discussion?
   
   



-- 
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