alpass163 commented on code in PR #17102:
URL: https://github.com/apache/iotdb/pull/17102#discussion_r2740424070


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableHeaderSchemaValidator.java:
##########
@@ -172,6 +176,32 @@ public Optional<TableSchema> validateTableHeaderSchema(
           }
         }
       }
+      long realTimeIndex = 0;
+      boolean realWithoutTimeColumn = true;
+
+      for (final TsTableColumnSchema schema : table.getColumnList()) {
+        if (schema.getColumnCategory() == TsTableColumnCategory.TIME) {
+          realWithoutTimeColumn = false;
+          break;
+        }
+        if (schema.getColumnCategory() != TsTableColumnCategory.ATTRIBUTE) {
+          ++realTimeIndex;
+        }
+      }
+
+      long inputTimeIndex = 0;
+      boolean inputWithoutTimeColumn = true;
+      for (final ColumnSchema schema : tableSchema.getColumns()) {
+        if (schema.getColumnCategory() == TsTableColumnCategory.TIME) {
+          inputWithoutTimeColumn = false;
+          break;
+        }
+        ++inputTimeIndex;
+      }
+      if (inputWithoutTimeColumn != realWithoutTimeColumn
+          || !inputWithoutTimeColumn && inputTimeIndex != realTimeIndex) {

Review Comment:
   well, the code logic works



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