loserwang1024 commented on code in PR #2416:
URL: https://github.com/apache/fluss/pull/2416#discussion_r2715219994
##########
fluss-common/src/main/java/org/apache/fluss/metadata/Schema.java:
##########
@@ -285,18 +285,21 @@ private Builder() {
/** Adopts all members from the given schema. */
public Builder fromSchema(Schema schema) {
- columns.addAll(schema.columns);
- if (schema.primaryKey != null) {
- primaryKeyNamed(schema.primaryKey.constraintName,
schema.primaryKey.columnNames);
- }
- if (schema.autoIncrementColumnNames != null
- && !schema.autoIncrementColumnNames.isEmpty()) {
- checkState(
- schema.autoIncrementColumnNames.size() == 1,
- "Multiple auto increment columns are not supported
yet.");
- enableAutoIncrement(schema.autoIncrementColumnNames.get(0));
- }
- this.highestFieldId = new AtomicInteger(schema.highestFieldId);
+ // Check that the builder is empty before adopting from an
existing schema
+ checkState(
Review Comment:
It's very useful check. Maybe we can move this to fromColumns. Thus, they
can share the same check. A
--
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]