wuchong commented on code in PR #1887:
URL: https://github.com/apache/fluss/pull/1887#discussion_r2581883655


##########
fluss-common/src/main/java/org/apache/fluss/metadata/Schema.java:
##########
@@ -62,8 +63,11 @@ public final class Schema implements Serializable {
     private final @Nullable PrimaryKey primaryKey;
     private final RowType rowType;
 
-    private Schema(List<Column> columns, @Nullable PrimaryKey primaryKey) {
-        this.columns = normalizeColumns(columns, primaryKey);
+    private Schema(
+            List<Column> columns,
+            @Nullable PrimaryKey primaryKey,
+            @Nullable String autoIncrementColumn) {
+        this.columns = normalizeColumns(columns, primaryKey, 
autoIncrementColumn);

Review Comment:
   I believe it’s cleaner to store auto-increment column information at the 
**`Schema`** level rather than within individual **`Column`** objects. This 
aligns with how primary keys are currently modeled and makes it straightforward 
to retrieve the full set of auto-increment columns without iterating over all 
columns.
   
   Additionally, adding new fields to `Column` would require multiple 
constructor overloads, unnecessarily complicating the API.
   
   Given that we may eventually support **multiple auto-increment columns**, I 
propose using `List<String>` (e.g., `Schema#getAutoIncrementColumnNames()`) 
instead of a single `@Nullable String`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to