aokolnychyi commented on code in PR #50593:
URL: https://github.com/apache/spark/pull/50593#discussion_r2065155777


##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/ColumnDefaultValue.java:
##########
@@ -33,25 +34,20 @@
  * data that do not have these new columns.
  */
 @Evolving
-public class ColumnDefaultValue {
-  private String sql;
-  private Literal<?> value;
+public class ColumnDefaultValue extends DefaultValue {
+  private final Literal<?> value;
 
   public ColumnDefaultValue(String sql, Literal<?> value) {
-    this.sql = sql;
-    this.value = value;
+    this(sql, null /* no expression */, value);
   }
 
-  /**
-   * Returns the SQL string (Spark SQL dialect) of the default value 
expression. This is the
-   * original string contents of the SQL expression specified at the time the 
column was created in
-   * a CREATE TABLE, REPLACE TABLE, or ADD COLUMN command. For example, for
-   * "CREATE TABLE t (col INT DEFAULT 40 + 2)", this returns the string 
literal "40 + 2" (without
-   * quotation marks).
-   */
-  @Nonnull
-  public String getSql() {
-    return sql;
+  public ColumnDefaultValue(Expression expr, Literal<?> value) {
+    this(null /* no sql */, expr, value);
+  }
+
+  public ColumnDefaultValue(String sql, Expression expr, Literal<?> value) {

Review Comment:
   I agree the name is a bit confusing, but I'd prefer to do the rename 
separately. It will also be limited to internal variables as we can't change 
public methods. I'd also argue the naming of "initial" and "write" defaults in 
Iceberg makes a bit more sense than "current" and "exists" we use in Spark.



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