JackieTien97 commented on code in PR #12707:
URL: https://github.com/apache/iotdb/pull/12707#discussion_r1634588513


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/Metadata.java:
##########
@@ -67,4 +68,29 @@ List<DeviceEntry> indexScan(
       QualifiedObjectName tableName,
       List<Expression> expressionList,
       List<String> attributeColumns);
+
+  /**
+   * This method is used for table column validation and should be invoked 
before device validation.
+   *
+   * <p>This method return all the existing column schemas in the target table.
+   *
+   * <p>When table or column is missing, this method will execute auto 
creation.
+   *
+   * <p>When using SQL, the columnSchemaList could be null and there won't be 
any validation.
+   *
+   * <p>When the input dataType or category of one column is null, the column 
cannot be auto
+   * created.
+   */
+  TableSchema validateTableHeaderSchema(
+      String database, TableSchema tableSchema, MPPQueryContext context);
+
+  /**
+   * This method is used for table device validation and should be invoked 
after column validation.
+   *
+   * <p>When device id is missing, this method will execute auto creation.
+   *
+   * <p>When device attribute is missing or different from that stored in 
IoTDB, the attribute will
+   * be auto upsert.
+   */
+  void validateDeviceSchema(ITableDeviceSchemaValidation schemaValidation, 
MPPQueryContext context);

Review Comment:
   After confirmation with @jt2594838 and @qiaojialin , auto create won't 
affect device creation, so the creation for device won't failed because of 
auto_create is false, but there may be other reasons.
   
   If your current implementation will throw some specific exception if any 
device creation failed, it's ok but you need add that exception in java doc and 
make your interface more clear.



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to