gengliangwang commented on code in PR #50631: URL: https://github.com/apache/spark/pull/50631#discussion_r2054469701
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/constraints.scala: ########## @@ -112,6 +117,27 @@ case class CheckConstraint( with TableConstraint { // scalastyle:on line.size.limit + def toV2Constraint(isCreateTable: Boolean): Constraint = { + val predicate = new V2ExpressionBuilder(child, true).buildPredicate().orNull + val enforced = userProvidedCharacteristic.enforced.getOrElse(true) + val rely = userProvidedCharacteristic.rely.getOrElse(false) + // The validation status is set to UNVALIDATED for create table and + // VALID for alter table. + val validateStatus = if (isCreateTable) { + Constraint.ValidationStatus.UNVALIDATED + } else { + Constraint.ValidationStatus.VALID Review Comment: Yes for check constraint -- 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