You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by zy...@apache.org on 2024/04/22 01:36:35 UTC

(iotdb) 07/07: add warn

This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch table-model-debug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0dfdb3008fb107b9b8997cd11e23df5e7de4ccc6
Author: MarcosZyk <15...@qq.com>
AuthorDate: Mon Apr 22 09:35:19 2024 +0800

    add warn
---
 .../db/queryengine/plan/statement/crud/InsertTableStatement.java     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTableStatement.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTableStatement.java
index 28d5804c848..a884e8d69da 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTableStatement.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/crud/InsertTableStatement.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.commons.schema.table.TsTable;
 import org.apache.iotdb.commons.schema.table.column.MeasurementColumnSchema;
 import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory;
+import org.apache.iotdb.commons.schema.table.column.TsTableColumnSchema;
 import org.apache.iotdb.db.exception.sql.SemanticException;
 import org.apache.iotdb.db.protocol.session.IClientSession;
 import org.apache.iotdb.db.queryengine.plan.relational.analyzer.schema.ITableDeviceSchemaValidation;
@@ -100,6 +101,10 @@ public class InsertTableStatement extends Statement implements ITableDeviceSchem
           hasColumn
               ? columnNameList.get(i).getValue()
               : table.getColumnList().get(i).getColumnName();
+      TsTableColumnSchema columnSchema = table.getColumnSchema(columnName);
+      if (columnSchema == null) {
+        throw new SemanticException(String.format("Unknown Column %s", columnName));
+      }
       TsTableColumnCategory category = table.getColumnSchema(columnName).getColumnCategory();
       if (category.equals(TsTableColumnCategory.ID)) {
         idColumnMap.put(columnName, ((Identifier) values.get(i)).getValue());