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


##########
fluss-common/src/main/java/org/apache/fluss/metadata/Schema.java:
##########
@@ -331,19 +411,27 @@ public Schema build() {
      */
     @PublicStable
     public static final class Column implements Serializable {
+        public static final short UNKNOWN_COLUMN_ID = -1;
         private static final long serialVersionUID = 1L;
+        private final short columnId;
         private final String columnName;
         private final DataType dataType;
         private final @Nullable String comment;
 
         public Column(String columnName, DataType dataType) {
-            this(columnName, dataType, null);
+            this(columnName, dataType, null, UNKNOWN_COLUMN_ID);

Review Comment:
   We should be able to get the column id for the previous schema (use the 
column order). Using -1 as default column is error-prone. 



##########
fluss-server/src/main/java/org/apache/fluss/server/zk/ZooKeeperClient.java:
##########
@@ -810,16 +810,18 @@ public void registerPartitionAssignmentAndMetadata(
 
     /** Register schema to ZK metadata and return the schema id. */
     public int registerSchema(TablePath tablePath, Schema schema) throws 
Exception {
-        int currentSchemaId = getCurrentSchemaId(tablePath);
+        return registerSchema(tablePath, schema, getCurrentSchemaId(tablePath) 
+ 1);

Review Comment:
   This is creating a new table, we can directly use schema id = 1 here? 



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