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


##########
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:
   First, We haven't define what is "partial insert" in table model. Device 
level or series level?  Second, to support partial insert, another interface 
"markFailed(int index)" shall be added to the ITableDeviceSchemaValidation and 
will be recalled during validation process. 
   
   For "auto create succeed or this device already exists before", no exception 
or info should be return in current stage. Id column data type may be should be 
returned if we support device id values with different data type.



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