SteveYurongSu commented on code in PR #14341:
URL: https://github.com/apache/iotdb/pull/14341#discussion_r1884971469
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableHeaderSchemaValidator.java:
##########
@@ -119,6 +120,27 @@ public Optional<TableSchema> validateTableHeaderSchema(
} else {
throw new SemanticException("Table " + tableSchema.getTableName() + "
does not exist");
}
+ } else {
+ // If table with this name already exists and isStrictIdColumn is true,
make sure the existing
+ // id columns are the prefix of the incoming id columns
+ if (isStrictIdColumn) {
+ final List<TsTableColumnSchema> idColumns =
table.getIdColumnSchemaList();
+ for (int indexInIncoming = 0; indexInIncoming < idColumns.size();
indexInIncoming++) {
+ final String idName = idColumns.get(indexInIncoming).getColumnName();
+ final int indexInExisting =
tableSchema.getIndexAmongIdColumns(idName);
+ if (indexInExisting == -1) {
+ throw new SemanticException(
+ String.format(
+ "Incoming id column %s not found in existing table in
IoTDB", idName));
+ }
Review Comment:
...
--
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]