You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "gengliangwang (via GitHub)" <gi...@apache.org> on 2026/04/29 00:02:01 UTC

Re: [PR] [SPARK-56652][SQL] Always emit RELY/NORELY in DESCRIBE EXTENDED constraint output [spark]

gengliangwang commented on code in PR #55590:
URL: https://github.com/apache/spark/pull/55590#discussion_r3157912251


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/constraints/BaseConstraint.java:
##########
@@ -74,13 +74,11 @@ public String toDDL() {
   }
 
   public String toDescription() {

Review Comment:
   Since this PR establishes the invariant `toDDL == "CONSTRAINT " + name + " " + toDescription`, consider implementing it structurally so the two methods can't drift apart, e.g. simplify `toDDL` above to:
   
   ```java
   @Override
   public String toDDL() {
     // The validation status is not included in the DDL output as it's not part of
     // the Spark SQL syntax for constraints.
     return "CONSTRAINT " + name + " " + toDescription();
   }
   ```
   
   This also removes the duplicated `String.format` template.



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