cloud-fan commented on code in PR #50584:
URL: https://github.com/apache/spark/pull/50584#discussion_r2043809104


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/constraints.scala:
##########
@@ -98,40 +124,34 @@ case class CheckConstraint(
 
   override def withName(name: String): TableConstraint = copy(name = name)
 
-  override def withCharacteristic(
-      c: ConstraintCharacteristic,
-      ctx: ParserRuleContext): TableConstraint =
+  override def withTableName(tableName: String): TableConstraint = 
copy(tableName = tableName)
+
+  override def withCharacteristic(c: ConstraintCharacteristic): 
TableConstraint =
     copy(characteristic = c)
 }
 
 case class PrimaryKeyConstraint(
     columns: Seq[String],
     override val name: String = null,
+    override val tableName: String = null,
     override val characteristic: ConstraintCharacteristic = 
ConstraintCharacteristic.empty)
   extends TableConstraint {
   override protected def generateConstraintName(tableName: String): String = 
s"${tableName}_pk"
 
   override def withName(name: String): TableConstraint = copy(name = name)
 
-  override def withCharacteristic(
-    c: ConstraintCharacteristic,
-    ctx: ParserRuleContext): TableConstraint = {
-    if (c.enforced.contains(true)) {
-      throw new ParseException(
-        errorClass = "UNSUPPORTED_CONSTRAINT_CHARACTERISTIC",
-        messageParameters = Map(
-          "characteristic" -> "ENFORCED",
-          "constraintType" -> "PRIMARY KEY"),
-        ctx = ctx

Review Comment:
   so we do not have the error context for this error anymore?



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

Reply via email to