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

shuwenwei pushed a commit to branch read_tsfile_table_function
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/read_tsfile_table_function by 
this push:
     new 3106fa17d1c fix i18n
3106fa17d1c is described below

commit 3106fa17d1c2de8776c7a7774f3a92c4ca070151
Author: shuwenwei <[email protected]>
AuthorDate: Tue Jun 16 14:06:50 2026 +0800

    fix i18n
---
 .../iotdb/db/i18n/DataNodeQueryMessages.java       | 98 ++++++++++++++++++++++
 .../iotdb/db/i18n/DataNodeQueryMessages.java       | 97 +++++++++++++++++++++
 .../ExternalTsFileAggTableScanOperator.java        | 11 ++-
 .../ExternalTsFileDeviceFilterVisitor.java         |  8 +-
 .../ExternalTsFileTableScanOperator.java           | 14 ++--
 .../readTsFile/ExternalTsFileQueryResource.java    | 29 ++++---
 .../tvf/readTsFile/ReadTsFileTableFunction.java    | 35 ++++----
 .../tvf/readTsFile/TsFileSchemaCollector.java      | 46 +++++-----
 .../plan/relational/planner/RelationPlanner.java   |  3 +-
 .../node/ExternalTsFileAggregationScanNode.java    |  8 +-
 .../planner/node/ExternalTsFileScanNode.java       |  8 +-
 .../optimizations/PushPredicateIntoTableScan.java  |  3 +-
 12 files changed, 295 insertions(+), 65 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
 
b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
index b63739fef9b..252e415972b 100644
--- 
a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
+++ 
b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
@@ -197,6 +197,21 @@ public final class DataNodeQueryMessages {
       "Failed to close reader in TableDiskUsageSupplier";
   public static final String UNSUPPORTED_CATEGORY =
       "Unsupported category: ";
+  public static final String 
CURRENT_DEVICE_ENTRY_IN_TABLESCANOPERATOR_IS_EMPTY =
+      "Current device entry in TableScanOperator is empty";
+  public static final String 
UNEXPECTED_END_OF_EXTERNAL_TSFILE_DEVICE_TASK_READER_AT_DEVICE_INDEX =
+      "Unexpected end of external TsFile device task reader at device index ";
+  public static final String
+      EXTERNAL_TSFILE_DEVICE_TASK_READER_IS_NOT_ALIGNED_WITH_DEVICE_ENTRIES =
+          "External TsFile device task reader is not aligned with device 
entries at index %d:"
+              + " expected %s but got %s";
+  public static final String FAILED_TO_UPDATE_EXTERNAL_TSFILE_DEVICE_RESOURCES 
=
+      "Failed to update external TsFile device resources";
+  public static final String SCHEMA_FILTER_TYPE_IS_NOT_SUPPORTED =
+      "The schema filter type %s is not supported";
+  public static final String
+      ATTRIBUTE_FILTER_IS_NOT_SUPPORTED_FOR_EXTERNAL_TSFILE_DEVICE_FILTERING =
+          "Attribute filter is not supported for external TsFile device 
filtering";
 
   // --- Execution / Operator / Window ---
 
@@ -761,6 +776,77 @@ public final class DataNodeQueryMessages {
       "Tag column only support data type STRING.";
   public static final String ATTRIBUTE_COLUMN_ONLY_SUPPORT_DATA_TYPE_STRING =
       "Attribute column only support data type STRING.";
+  public static final String UNSUPPORTED_EXTERNAL_TSFILE_DEVICE_FILTER =
+      "Unsupported external TsFile device filter: ";
+
+  // --- Plan / Relational / Table Function ---
+
+  public static final String NO_TABLE_SCHEMA_FOUND_IN_TSFILES =
+      "No table schema found in TsFiles";
+  public static final String NO_TABLE_SCHEMA_FOUND_FOR_TABLE_IN_TSFILES =
+      "No table schema found for table %s in TsFiles";
+  public static final String 
READ_TSFILE_MUST_BE_PLANNED_AS_EXTERNAL_TSFILE_SCAN_NODE =
+      "readTsFile must be planned as an ExternalTsFileScanNode";
+  public static final String MISSING_SCALAR_ARGUMENT =
+      "Missing scalar argument: ";
+  public static final String ARGUMENT_SHOULD_NOT_BE_EMPTY =
+      "Argument %s should not be empty";
+  public static final String INVALID_SCALAR_ARGUMENT =
+      "Invalid scalar argument: ";
+  public static final String ARGUMENT_SHOULD_BE_A_STRING =
+      "Argument %s should be a string";
+  public static final String ARGUMENT_SHOULD_CONTAIN_AT_LEAST_ONE_PATH =
+      "Argument %s should contain at least one path";
+  public static final String READ_TSFILE_PATH_IS_NOT_ALLOWED =
+      "readTsFile path %s is not allowed because it may access IoTDB data 
directory %s";
+  public static final String OUTPUT_COLUMN_NAMES_AND_TYPES_SIZE_MISMATCH =
+      "Output column names and types size mismatch";
+  public static final String OUTPUT_COLUMN_NAMES_AND_CATEGORIES_SIZE_MISMATCH =
+      "Output column names and categories size mismatch";
+  public static final String 
READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_SERIALIZATION =
+      "ReadTsFileTableFunctionHandle does not support serialization";
+  public static final String 
READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_DESERIALIZATION =
+      "ReadTsFileTableFunctionHandle does not support deserialization";
+  public static final String TSFILE_PATH_DOES_NOT_EXIST =
+      "TsFile path does not exist: ";
+  public static final String TSFILE_PATH_IS_NEITHER_A_FILE_NOR_A_DIRECTORY =
+      "TsFile path is neither a file nor a directory: ";
+  public static final String NO_VALID_TSFILES_FOUND =
+      "No valid TsFiles found";
+  public static final String FAILED_TO_SCAN_TSFILE_PATH =
+      "Failed to scan TsFile path: ";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILES_MULTIPLE_TABLES =
+      "Cannot infer table name from TsFiles because multiple tables are found: 
%s and %s";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILE_NO_TABLE_SCHEMA =
+      "Cannot infer table name from TsFile because no table schema is found in 
";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILE_MULTIPLE_TABLES =
+      "Cannot infer table name from TsFile because multiple tables are found 
in ";
+  public static final String FILE_IS_NOT_A_VALID_TSFILE =
+      "File is not a valid TsFile: ";
+  public static final String 
MULTIPLE_TIME_COLUMNS_FOUND_WHEN_MERGING_TABLE_SCHEMA =
+      "Multiple time columns found when merging table schema for table ";
+  public static final String TIME_COLUMN_CONFLICTS_WHEN_MERGING_TABLE_SCHEMA =
+      "Time column conflicts when merging table schema for table ";
+  public static final String TAG_COLUMNS_CONFLICT_WHEN_MERGING_TABLE_SCHEMA =
+      "Tag columns conflict when merging table schema for table ";
+  public static final String 
FIELD_COLUMN_HAS_CONFLICTING_DATA_TYPES_WHEN_MERGING_TABLE_SCHEMA =
+      "Field column %s has conflicting data types when merging table schema 
for table %s";
+  public static final String 
COLUMN_HAS_CONFLICTING_CATEGORIES_WHEN_MERGING_TABLE_SCHEMA =
+      "Column %s has conflicting categories when merging table schema for 
table %s";
+  public static final String 
FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_TASK_RUN_READER =
+      "Failed to create external TsFile device task run reader";
+  public static final String UNKNOWN_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION =
+      "Unknown external TsFile device task partition: ";
+  public static final String EXTERNAL_TSFILE_QUERY_RESOURCE_HAS_BEEN_CLOSED =
+      "External TsFile query resource has been closed: ";
+  public static final String FAILED_TO_DESERIALIZE_EXTERNAL_TSFILE_RESOURCE =
+      "Failed to deserialize external TsFile resource: %s, %s";
+  public static final String 
FAILED_TO_FLUSH_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION =
+      "Failed to flush external TsFile device task partition";
+  public static final String 
EXTERNAL_TSFILE_DEVICE_TASK_PARTITION_COUNT_MUST_BE_POSITIVE =
+      "External TsFile device task partition count must be positive";
+  public static final String FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_COLLECTOR 
=
+      "Failed to create external TsFile device collector";
 
   // --- Plan / Relational / Planner ---
 
@@ -804,6 +890,8 @@ public final class DataNodeQueryMessages {
       "Values is not supported in current version.";
   public static final String SUBSCRIPT_IS_NOT_SUPPORTED_IN_CURRENT_VERSION =
       "Subscript is not supported in current version";
+  public static final String READ_TSFILE_TABLE_FUNCTION_HANDLE_IS_INVALID =
+      "readTsFile table function handle is invalid";
 
   // --- Plan / Relational / Planner / IR ---
 
@@ -833,6 +921,16 @@ public final class DataNodeQueryMessages {
       "Not supported yet.";
   public static final String COPYTONODE_SHOULD_NOT_BE_SERIALIZED =
       "CopyToNode should not be serialized";
+  public static final String
+      
EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES
 =
+          "ExternalTsFileAggregationScanNode device entries must be set by 
device entry indexes";
+  public static final String 
EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_CANNOT_BE_SERIALIZED =
+      "ExternalTsFileAggregationScanNode cannot be serialized because it reads 
local external TsFiles";
+  public static final String
+      
EXTERNAL_TSFILE_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES =
+          "ExternalTsFileScanNode device entries must be set by device entry 
indexes";
+  public static final String EXTERNAL_TSFILE_SCAN_NODE_CANNOT_BE_SERIALIZED =
+      "ExternalTsFileScanNode cannot be serialized because it reads local 
external TsFiles";
 
   // --- Plan / Relational / Planner / Optimizations ---
 
diff --git 
a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
 
b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
index e70f00f2db9..9f6e0ba30d4 100644
--- 
a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
+++ 
b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
@@ -197,6 +197,20 @@ public final class DataNodeQueryMessages {
       "在 TableDiskUsageSupplier 中关闭 reader 失败";
   public static final String UNSUPPORTED_CATEGORY =
       "不支持的列类别:";
+  public static final String 
CURRENT_DEVICE_ENTRY_IN_TABLESCANOPERATOR_IS_EMPTY =
+      "TableScanOperator 中当前设备条目为空";
+  public static final String 
UNEXPECTED_END_OF_EXTERNAL_TSFILE_DEVICE_TASK_READER_AT_DEVICE_INDEX =
+      "外部 TsFile 设备任务读取器在设备索引处意外结束:";
+  public static final String
+      EXTERNAL_TSFILE_DEVICE_TASK_READER_IS_NOT_ALIGNED_WITH_DEVICE_ENTRIES =
+          "外部 TsFile 设备任务读取器与设备条目不匹配,索引 %d:期望 %s,实际 %s";
+  public static final String FAILED_TO_UPDATE_EXTERNAL_TSFILE_DEVICE_RESOURCES 
=
+      "更新外部 TsFile 设备资源失败";
+  public static final String SCHEMA_FILTER_TYPE_IS_NOT_SUPPORTED =
+      "不支持 SchemaFilter 类型 %s";
+  public static final String
+      ATTRIBUTE_FILTER_IS_NOT_SUPPORTED_FOR_EXTERNAL_TSFILE_DEVICE_FILTERING =
+          "外部 TsFile 设备过滤暂不支持属性过滤";
 
   // --- Execution / Operator / Window ---
 
@@ -760,6 +774,77 @@ public final class DataNodeQueryMessages {
       "标签列仅支持 STRING 数据类型。";
   public static final String ATTRIBUTE_COLUMN_ONLY_SUPPORT_DATA_TYPE_STRING =
       "属性列仅支持 STRING 数据类型。";
+  public static final String UNSUPPORTED_EXTERNAL_TSFILE_DEVICE_FILTER =
+      "不支持的外部 TsFile 设备过滤器:";
+
+  // --- Plan / Relational / Table Function ---
+
+  public static final String NO_TABLE_SCHEMA_FOUND_IN_TSFILES =
+      "TsFile 中未找到表结构";
+  public static final String NO_TABLE_SCHEMA_FOUND_FOR_TABLE_IN_TSFILES =
+      "TsFile 中未找到表 %s 的表结构";
+  public static final String 
READ_TSFILE_MUST_BE_PLANNED_AS_EXTERNAL_TSFILE_SCAN_NODE =
+      "readTsFile 必须规划为 ExternalTsFileScanNode";
+  public static final String MISSING_SCALAR_ARGUMENT =
+      "缺少标量参数:";
+  public static final String ARGUMENT_SHOULD_NOT_BE_EMPTY =
+      "参数 %s 不应为空";
+  public static final String INVALID_SCALAR_ARGUMENT =
+      "无效的标量参数:";
+  public static final String ARGUMENT_SHOULD_BE_A_STRING =
+      "参数 %s 应为字符串";
+  public static final String ARGUMENT_SHOULD_CONTAIN_AT_LEAST_ONE_PATH =
+      "参数 %s 应至少包含一个路径";
+  public static final String READ_TSFILE_PATH_IS_NOT_ALLOWED =
+      "不允许 readTsFile 路径 %s,因为它可能访问 IoTDB 数据目录 %s";
+  public static final String OUTPUT_COLUMN_NAMES_AND_TYPES_SIZE_MISMATCH =
+      "输出列名和类型数量不匹配";
+  public static final String OUTPUT_COLUMN_NAMES_AND_CATEGORIES_SIZE_MISMATCH =
+      "输出列名和类别数量不匹配";
+  public static final String 
READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_SERIALIZATION =
+      "ReadTsFileTableFunctionHandle 不支持序列化";
+  public static final String 
READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_DESERIALIZATION =
+      "ReadTsFileTableFunctionHandle 不支持反序列化";
+  public static final String TSFILE_PATH_DOES_NOT_EXIST =
+      "TsFile 路径不存在:";
+  public static final String TSFILE_PATH_IS_NEITHER_A_FILE_NOR_A_DIRECTORY =
+      "TsFile 路径既不是文件也不是目录:";
+  public static final String NO_VALID_TSFILES_FOUND =
+      "未找到有效的 TsFile";
+  public static final String FAILED_TO_SCAN_TSFILE_PATH =
+      "扫描 TsFile 路径失败:";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILES_MULTIPLE_TABLES =
+      "无法从 TsFile 推断表名,因为发现了多个表:%s 和 %s";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILE_NO_TABLE_SCHEMA =
+      "无法从 TsFile 推断表名,因为未找到表结构,文件:";
+  public static final String 
CANNOT_INFER_TABLE_NAME_FROM_TSFILE_MULTIPLE_TABLES =
+      "无法从 TsFile 推断表名,因为发现了多个表,文件:";
+  public static final String FILE_IS_NOT_A_VALID_TSFILE =
+      "文件不是有效的 TsFile:";
+  public static final String 
MULTIPLE_TIME_COLUMNS_FOUND_WHEN_MERGING_TABLE_SCHEMA =
+      "合并表结构时发现多个时间列,表:";
+  public static final String TIME_COLUMN_CONFLICTS_WHEN_MERGING_TABLE_SCHEMA =
+      "合并表结构时时间列冲突,表:";
+  public static final String TAG_COLUMNS_CONFLICT_WHEN_MERGING_TABLE_SCHEMA =
+      "合并表结构时标签列冲突,表:";
+  public static final String 
FIELD_COLUMN_HAS_CONFLICTING_DATA_TYPES_WHEN_MERGING_TABLE_SCHEMA =
+      "字段列 %s 在合并表 %s 的结构时存在冲突的数据类型";
+  public static final String 
COLUMN_HAS_CONFLICTING_CATEGORIES_WHEN_MERGING_TABLE_SCHEMA =
+      "列 %s 在合并表 %s 的结构时存在冲突的类别";
+  public static final String 
FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_TASK_RUN_READER =
+      "创建外部 TsFile 设备任务运行读取器失败";
+  public static final String UNKNOWN_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION =
+      "未知的外部 TsFile 设备任务分区:";
+  public static final String EXTERNAL_TSFILE_QUERY_RESOURCE_HAS_BEEN_CLOSED =
+      "外部 TsFile 查询资源已关闭:";
+  public static final String FAILED_TO_DESERIALIZE_EXTERNAL_TSFILE_RESOURCE =
+      "反序列化外部 TsFile 资源失败:%s,%s";
+  public static final String 
FAILED_TO_FLUSH_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION =
+      "刷写外部 TsFile 设备任务分区失败";
+  public static final String 
EXTERNAL_TSFILE_DEVICE_TASK_PARTITION_COUNT_MUST_BE_POSITIVE =
+      "外部 TsFile 设备任务分区数量必须为正数";
+  public static final String FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_COLLECTOR 
=
+      "创建外部 TsFile 设备收集器失败";
 
   // --- Plan / Relational / Planner ---
 
@@ -803,6 +888,8 @@ public final class DataNodeQueryMessages {
       "当前版本不支持 Values。";
   public static final String SUBSCRIPT_IS_NOT_SUPPORTED_IN_CURRENT_VERSION =
       "当前版本不支持下标操作";
+  public static final String READ_TSFILE_TABLE_FUNCTION_HANDLE_IS_INVALID =
+      "readTsFile 表函数句柄无效";
 
   // --- Plan / Relational / Planner / IR ---
 
@@ -832,6 +919,16 @@ public final class DataNodeQueryMessages {
       "暂不支持。";
   public static final String COPYTONODE_SHOULD_NOT_BE_SERIALIZED =
       "CopyToNode 不应被序列化";
+  public static final String
+      
EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES
 =
+          "ExternalTsFileAggregationScanNode 的设备条目必须通过设备条目索引设置";
+  public static final String 
EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_CANNOT_BE_SERIALIZED =
+      "ExternalTsFileAggregationScanNode 读取本地外部 TsFile,因此不能被序列化";
+  public static final String
+      
EXTERNAL_TSFILE_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES =
+          "ExternalTsFileScanNode 的设备条目必须通过设备条目索引设置";
+  public static final String EXTERNAL_TSFILE_SCAN_NODE_CANNOT_BE_SERIALIZED =
+      "ExternalTsFileScanNode 读取本地外部 TsFile,因此不能被序列化";
 
   // --- Plan / Relational / Planner / Optimizations ---
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileAggTableScanOperator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileAggTableScanOperator.java
index a3e7566fc93..fe2cdfab6a8 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileAggTableScanOperator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileAggTableScanOperator.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.queryengine.execution.operator.source.relational;
 
 import org.apache.iotdb.commons.path.AlignedFullPath;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.execution.operator.OperatorContext;
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.SeriesScanUtil;
 import 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile.ExternalTsFileQueryDataSource;
@@ -123,7 +124,8 @@ public class ExternalTsFileAggTableScanOperator extends 
DefaultAggTableScanOpera
     try {
       if (!deviceTaskReader.nextDevice()) {
         throw new IllegalStateException(
-            "Unexpected end of external TsFile device task reader at device 
index "
+            DataNodeQueryMessages
+                    
.UNEXPECTED_END_OF_EXTERNAL_TSFILE_DEVICE_TASK_READER_AT_DEVICE_INDEX
                 + currentDeviceIndex);
       }
       DeviceEntry expectedDeviceEntry = deviceEntries.get(currentDeviceIndex);
@@ -131,15 +133,16 @@ public class ExternalTsFileAggTableScanOperator extends 
DefaultAggTableScanOpera
       if 
(!expectedDeviceEntry.getDeviceID().equals(currentDeviceEntry.getDeviceID())) {
         throw new IllegalStateException(
             String.format(
-                "External TsFile device task reader is not aligned with device 
entries at index %d:"
-                    + " expected %s but got %s",
+                DataNodeQueryMessages
+                    
.EXTERNAL_TSFILE_DEVICE_TASK_READER_IS_NOT_ALIGNED_WITH_DEVICE_ENTRIES,
                 currentDeviceIndex,
                 expectedDeviceEntry.getDeviceID(),
                 currentDeviceEntry.getDeviceID()));
       }
       return deviceTaskReader.getCurrentDeviceQueryDataSource();
     } catch (IOException e) {
-      throw new RuntimeException("Failed to update external TsFile device 
resources", e);
+      throw new RuntimeException(
+          
DataNodeQueryMessages.FAILED_TO_UPDATE_EXTERNAL_TSFILE_DEVICE_RESOURCES, e);
     }
   }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileDeviceFilterVisitor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileDeviceFilterVisitor.java
index 005491d2b6e..d26713ae7db 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileDeviceFilterVisitor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileDeviceFilterVisitor.java
@@ -24,6 +24,7 @@ import 
org.apache.iotdb.commons.schema.filter.SchemaFilterVisitor;
 import org.apache.iotdb.commons.schema.filter.impl.StringValueFilterVisitor;
 import org.apache.iotdb.commons.schema.filter.impl.singlechild.AttributeFilter;
 import org.apache.iotdb.commons.schema.filter.impl.singlechild.TagFilter;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 
 import org.apache.tsfile.file.metadata.IDeviceID;
 
@@ -32,7 +33,9 @@ public class ExternalTsFileDeviceFilterVisitor extends 
SchemaFilterVisitor<IDevi
   @Override
   protected Boolean visitNode(final SchemaFilter filter, final IDeviceID 
deviceID) {
     throw new UnsupportedOperationException(
-        "The schema filter type " + filter.getSchemaFilterType() + " is not 
supported");
+        String.format(
+            DataNodeQueryMessages.SCHEMA_FILTER_TYPE_IS_NOT_SUPPORTED,
+            filter.getSchemaFilterType()));
   }
 
   @Override
@@ -45,6 +48,7 @@ public class ExternalTsFileDeviceFilterVisitor extends 
SchemaFilterVisitor<IDevi
   @Override
   public Boolean visitAttributeFilter(final AttributeFilter filter, final 
IDeviceID deviceID) {
     throw new UnsupportedOperationException(
-        "Attribute filter is not supported for external TsFile device 
filtering");
+        DataNodeQueryMessages
+            
.ATTRIBUTE_FILTER_IS_NOT_SUPPORTED_FOR_EXTERNAL_TSFILE_DEVICE_FILTERING);
   }
 }
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileTableScanOperator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileTableScanOperator.java
index 59d072b1362..fc588c10d81 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileTableScanOperator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/ExternalTsFileTableScanOperator.java
@@ -21,6 +21,7 @@ package 
org.apache.iotdb.db.queryengine.execution.operator.source.relational;
 
 import org.apache.iotdb.calc.plan.planner.CommonOperatorUtils;
 import org.apache.iotdb.commons.path.AlignedFullPath;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.execution.operator.OperatorContext;
 import 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile.ExternalTsFileQueryDataSource;
 import 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile.ExternalTsFileQueryResource;
@@ -56,7 +57,8 @@ public class ExternalTsFileTableScanOperator extends 
TableScanOperator {
 
     DeviceEntry deviceEntry = deviceEntries.get(currentDeviceIndex);
     if (deviceEntry == null) {
-      throw new IllegalStateException("Current device entry in 
TableScanOperator is empty");
+      throw new IllegalStateException(
+          
DataNodeQueryMessages.CURRENT_DEVICE_ENTRY_IN_TABLESCANOPERATOR_IS_EMPTY);
     }
 
     this.seriesScanUtil =
@@ -110,7 +112,8 @@ public class ExternalTsFileTableScanOperator extends 
TableScanOperator {
     try {
       if (!deviceTaskReader.nextDevice()) {
         throw new IllegalStateException(
-            "Unexpected end of external TsFile device task reader at device 
index "
+            DataNodeQueryMessages
+                    
.UNEXPECTED_END_OF_EXTERNAL_TSFILE_DEVICE_TASK_READER_AT_DEVICE_INDEX
                 + currentDeviceIndex);
       }
       DeviceEntry expectedDeviceEntry = deviceEntries.get(currentDeviceIndex);
@@ -118,15 +121,16 @@ public class ExternalTsFileTableScanOperator extends 
TableScanOperator {
       if 
(!expectedDeviceEntry.getDeviceID().equals(currentDeviceEntry.getDeviceID())) {
         throw new IllegalStateException(
             String.format(
-                "External TsFile device task reader is not aligned with device 
entries at index %d:"
-                    + " expected %s but got %s",
+                DataNodeQueryMessages
+                    
.EXTERNAL_TSFILE_DEVICE_TASK_READER_IS_NOT_ALIGNED_WITH_DEVICE_ENTRIES,
                 currentDeviceIndex,
                 expectedDeviceEntry.getDeviceID(),
                 currentDeviceEntry.getDeviceID()));
       }
       return deviceTaskReader.getCurrentDeviceQueryDataSource();
     } catch (IOException e) {
-      throw new RuntimeException("Failed to update external TsFile device 
resources", e);
+      throw new RuntimeException(
+          
DataNodeQueryMessages.FAILED_TO_UPDATE_EXTERNAL_TSFILE_DEVICE_RESOURCES, e);
     }
   }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
index dfb1fd8b625..0d81d36ae37 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ExternalTsFileQueryResource.java
@@ -24,10 +24,11 @@ import 
org.apache.iotdb.calc.plan.planner.memory.MemoryReservationManager;
 import org.apache.iotdb.commons.schema.filter.SchemaFilter;
 import org.apache.iotdb.commons.utils.FileUtils;
 import org.apache.iotdb.commons.utils.TestOnly;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
 import org.apache.iotdb.db.queryengine.common.QueryId;
 import 
org.apache.iotdb.db.queryengine.execution.operator.source.relational.ExternalTsFileDeviceFilterVisitor;
-import 
org.apache.iotdb.db.queryengine.plan.planner.memory.ThreadSafeMemoryReservationManager;
+import 
org.apache.iotdb.db.queryengine.plan.planner.memory.NotThreadSafeMemoryReservationManager;
 import 
org.apache.iotdb.db.queryengine.plan.relational.metadata.AlignedDeviceEntry;
 import org.apache.iotdb.db.queryengine.plan.relational.metadata.DeviceEntry;
 import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSource;
@@ -104,7 +105,7 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
       boolean useExactTempRoot) {
     this.queryId = requireNonNull(queryContext, "queryContext is 
null").getQueryId();
     this.externalTsFileResourceMemoryReservationManager =
-        new ThreadSafeMemoryReservationManager(
+        new NotThreadSafeMemoryReservationManager(
             queryId, ExternalTsFileQueryResource.class.getName());
     this.queryTempRoot =
         useExactTempRoot
@@ -162,7 +163,8 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
     try {
       return new DeviceTaskRunReader(partition);
     } catch (IOException e) {
-      throw new RuntimeException("Failed to create external TsFile device task 
run reader", e);
+      throw new RuntimeException(
+          
DataNodeQueryMessages.FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_TASK_RUN_READER, 
e);
     }
   }
 
@@ -194,7 +196,7 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
       }
     }
     throw new IllegalArgumentException(
-        "Unknown external TsFile device task partition: " + partitionIndex);
+        DataNodeQueryMessages.UNKNOWN_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION + 
partitionIndex);
   }
 
   @Override
@@ -223,7 +225,8 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
 
   private void checkNotClosed() {
     if (closed) {
-      throw new IllegalStateException("External TsFile query resource has been 
closed: " + queryId);
+      throw new IllegalStateException(
+          DataNodeQueryMessages.EXTERNAL_TSFILE_QUERY_RESOURCE_HAS_BEEN_CLOSED 
+ queryId);
     }
   }
 
@@ -237,10 +240,10 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
           resource.deserialize();
         } catch (IOException e) {
           throw new RuntimeException(
-              "Failed to deserialize external TsFile resource: "
-                  + tsFilePath
-                  + ", "
-                  + e.getMessage(),
+              String.format(
+                  
DataNodeQueryMessages.FAILED_TO_DESERIALIZE_EXTERNAL_TSFILE_RESOURCE,
+                  tsFilePath,
+                  e.getMessage()),
               e);
         }
       } else {
@@ -292,7 +295,8 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
                 runFiles.size(),
                 pendingDeviceTasks));
       } catch (IOException e) {
-        throw new RuntimeException("Failed to flush external TsFile device 
task partition", e);
+        throw new RuntimeException(
+            
DataNodeQueryMessages.FAILED_TO_FLUSH_EXTERNAL_TSFILE_DEVICE_TASK_PARTITION, e);
       }
       for (DeviceTask deviceTask : pendingDeviceTasks) {
         deviceEntryIndexes.add(deviceTask.deviceEntryIndex);
@@ -393,7 +397,7 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
   private void createDeviceTaskPartitions(int partitionCount) {
     if (partitionCount <= 0) {
       throw new IllegalArgumentException(
-          "External TsFile device task partition count must be positive");
+          
DataNodeQueryMessages.EXTERNAL_TSFILE_DEVICE_TASK_PARTITION_COUNT_MUST_BE_POSITIVE);
     }
     for (int i = 0; i < partitionCount; i++) {
       deviceTaskPartitions.add(new DeviceTaskPartition(i));
@@ -643,7 +647,8 @@ public class ExternalTsFileQueryResource implements 
AutoCloseable {
         }
       } catch (IOException e) {
         close();
-        throw new RuntimeException("Failed to create external TsFile device 
collector", e);
+        throw new RuntimeException(
+            
DataNodeQueryMessages.FAILED_TO_CREATE_EXTERNAL_TSFILE_DEVICE_COLLECTOR, e);
       }
     }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ReadTsFileTableFunction.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ReadTsFileTableFunction.java
index e027ffd3cf1..c078115908f 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ReadTsFileTableFunction.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/ReadTsFileTableFunction.java
@@ -22,6 +22,7 @@ package 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile;
 import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory;
 import org.apache.iotdb.commons.udf.utils.UDFDataTypeTransformer;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.udf.api.exception.UDFArgumentNotValidException;
 import org.apache.iotdb.udf.api.exception.UDFException;
 import org.apache.iotdb.udf.api.relational.TableFunction;
@@ -78,8 +79,9 @@ public class ReadTsFileTableFunction implements TableFunction 
{
     if (mergedTableSchema == null) {
       throw new UDFArgumentNotValidException(
           tableName.isEmpty()
-              ? "No table schema found in TsFiles"
-              : "No table schema found for table " + tableName + " in 
TsFiles");
+              ? DataNodeQueryMessages.NO_TABLE_SCHEMA_FOUND_IN_TSFILES
+              : String.format(
+                  
DataNodeQueryMessages.NO_TABLE_SCHEMA_FOUND_FOR_TABLE_IN_TSFILES, tableName));
     }
     DescribedSchema outputSchema = convertToDescribedSchema(mergedTableSchema);
 
@@ -106,17 +108,18 @@ public class ReadTsFileTableFunction implements 
TableFunction {
   public TableFunctionProcessorProvider getProcessorProvider(
       TableFunctionHandle tableFunctionHandle) {
     throw new UnsupportedOperationException(
-        "readTsFile must be planned as an ExternalTsFileScanNode");
+        
DataNodeQueryMessages.READ_TSFILE_MUST_BE_PLANNED_AS_EXTERNAL_TSFILE_SCAN_NODE);
   }
 
   private static String getRequiredStringArgument(Map<String, Argument> 
arguments, String name) {
     Argument argument = arguments.get(name);
     if (!(argument instanceof ScalarArgument)) {
-      throw new UDFArgumentNotValidException("Missing scalar argument: " + 
name);
+      throw new 
UDFArgumentNotValidException(DataNodeQueryMessages.MISSING_SCALAR_ARGUMENT + 
name);
     }
     Object value = ((ScalarArgument) argument).getValue();
     if (!(value instanceof String) || ((String) value).trim().isEmpty()) {
-      throw new UDFArgumentNotValidException("Argument " + name + " should not 
be empty");
+      throw new UDFArgumentNotValidException(
+          String.format(DataNodeQueryMessages.ARGUMENT_SHOULD_NOT_BE_EMPTY, 
name));
     }
     return ((String) value).trim();
   }
@@ -127,11 +130,12 @@ public class ReadTsFileTableFunction implements 
TableFunction {
       return "";
     }
     if (!(argument instanceof ScalarArgument)) {
-      throw new UDFArgumentNotValidException("Invalid scalar argument: " + 
name);
+      throw new 
UDFArgumentNotValidException(DataNodeQueryMessages.INVALID_SCALAR_ARGUMENT + 
name);
     }
     Object value = ((ScalarArgument) argument).getValue();
     if (!(value instanceof String)) {
-      throw new UDFArgumentNotValidException("Argument " + name + " should be 
a string");
+      throw new UDFArgumentNotValidException(
+          String.format(DataNodeQueryMessages.ARGUMENT_SHOULD_BE_A_STRING, 
name));
     }
     return ((String) value).trim();
   }
@@ -144,7 +148,9 @@ public class ReadTsFileTableFunction implements 
TableFunction {
             .collect(Collectors.toList());
     if (paths.isEmpty()) {
       throw new UDFArgumentNotValidException(
-          "Argument " + PATHS_PARAMETER_NAME + " should contain at least one 
path");
+          String.format(
+              DataNodeQueryMessages.ARGUMENT_SHOULD_CONTAIN_AT_LEAST_ONE_PATH,
+              PATHS_PARAMETER_NAME));
     }
     return paths;
   }
@@ -160,8 +166,7 @@ public class ReadTsFileTableFunction implements 
TableFunction {
         if (normalizedTsFilePath.startsWith(dataDir) || 
dataDir.startsWith(normalizedTsFilePath)) {
           throw new UDFArgumentNotValidException(
               String.format(
-                  "readTsFile path %s is not allowed because it may access 
IoTDB data directory %s",
-                  tsFilePath, dataDir));
+                  DataNodeQueryMessages.READ_TSFILE_PATH_IS_NOT_ALLOWED, 
tsFilePath, dataDir));
         }
       }
     }
@@ -226,10 +231,12 @@ public class ReadTsFileTableFunction implements 
TableFunction {
         List<Type> outputColumnTypes,
         List<TsTableColumnCategory> outputColumnCategories) {
       if (outputColumnNames.size() != outputColumnTypes.size()) {
-        throw new IllegalArgumentException("Output column names and types size 
mismatch");
+        throw new IllegalArgumentException(
+            DataNodeQueryMessages.OUTPUT_COLUMN_NAMES_AND_TYPES_SIZE_MISMATCH);
       }
       if (outputColumnNames.size() != outputColumnCategories.size()) {
-        throw new IllegalArgumentException("Output column names and categories 
size mismatch");
+        throw new IllegalArgumentException(
+            
DataNodeQueryMessages.OUTPUT_COLUMN_NAMES_AND_CATEGORIES_SIZE_MISMATCH);
       }
       this.tableName = tableName;
       this.tsFilePaths = Collections.unmodifiableList(new 
ArrayList<>(tsFilePaths));
@@ -262,13 +269,13 @@ public class ReadTsFileTableFunction implements 
TableFunction {
     @Override
     public byte[] serialize() {
       throw new UnsupportedOperationException(
-          "ReadTsFileTableFunctionHandle does not support serialization");
+          
DataNodeQueryMessages.READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_SERIALIZATION);
     }
 
     @Override
     public void deserialize(byte[] bytes) {
       throw new UnsupportedOperationException(
-          "ReadTsFileTableFunctionHandle does not support deserialization");
+          
DataNodeQueryMessages.READ_TSFILE_TABLE_FUNCTION_HANDLE_DOES_NOT_SUPPORT_DESERIALIZATION);
     }
 
     @Override
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/TsFileSchemaCollector.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/TsFileSchemaCollector.java
index 395b6c9d6ca..090eda825ef 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/TsFileSchemaCollector.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/readTsFile/TsFileSchemaCollector.java
@@ -19,6 +19,7 @@
 
 package 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile;
 
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.udf.api.exception.UDFArgumentNotValidException;
 
 import org.apache.tsfile.common.conf.TSFileConfig;
@@ -61,7 +62,8 @@ final class TsFileSchemaCollector {
     for (String tsFilePath : tsFilePaths) {
       Path path = new File(tsFilePath).toPath();
       if (!Files.exists(path)) {
-        throw new UDFArgumentNotValidException("TsFile path does not exist: " 
+ tsFilePath);
+        throw new UDFArgumentNotValidException(
+            DataNodeQueryMessages.TSFILE_PATH_DOES_NOT_EXIST + tsFilePath);
       }
       if (Files.isRegularFile(path)) {
         TableSchema tableSchema = readTableSchema(specifiedTableName, 
path.toFile(), true);
@@ -70,12 +72,12 @@ final class TsFileSchemaCollector {
       }
       if (!Files.isDirectory(path)) {
         throw new UDFArgumentNotValidException(
-            "TsFile path is neither a file nor a directory: " + tsFilePath);
+            
DataNodeQueryMessages.TSFILE_PATH_IS_NEITHER_A_FILE_NOR_A_DIRECTORY + 
tsFilePath);
       }
       collectFromDirectory(tsFilePath, path);
     }
     if (tsFiles.isEmpty()) {
-      throw new UDFArgumentNotValidException("No valid TsFiles found");
+      throw new 
UDFArgumentNotValidException(DataNodeQueryMessages.NO_VALID_TSFILES_FOUND);
     }
   }
 
@@ -101,7 +103,8 @@ final class TsFileSchemaCollector {
         collect(filePath.toFile(), tableSchema);
       }
     } catch (IOException e) {
-      throw new UDFArgumentNotValidException("Failed to scan TsFile path: " + 
tsFilePath);
+      throw new UDFArgumentNotValidException(
+          DataNodeQueryMessages.FAILED_TO_SCAN_TSFILE_PATH + tsFilePath);
     }
   }
 
@@ -120,8 +123,9 @@ final class TsFileSchemaCollector {
     } else if (!tableName.equals(currentTableName)) {
       throw new UDFArgumentNotValidException(
           String.format(
-              "Cannot infer table name from TsFiles because multiple tables 
are found: %s and %s",
-              tableName, currentTableName));
+              
DataNodeQueryMessages.CANNOT_INFER_TABLE_NAME_FROM_TSFILES_MULTIPLE_TABLES,
+              tableName,
+              currentTableName));
     }
     tsFiles.add(tsFile);
     if (schemaBuilder == null) {
@@ -153,12 +157,12 @@ final class TsFileSchemaCollector {
       }
       if (tableSchemaMap.isEmpty()) {
         throw new UDFArgumentNotValidException(
-            "Cannot infer table name from TsFile because no table schema is 
found in "
+            
DataNodeQueryMessages.CANNOT_INFER_TABLE_NAME_FROM_TSFILE_NO_TABLE_SCHEMA
                 + tsFile.getAbsolutePath());
       }
       if (tableSchemaMap.size() > 1) {
         throw new UDFArgumentNotValidException(
-            "Cannot infer table name from TsFile because multiple tables are 
found in "
+            
DataNodeQueryMessages.CANNOT_INFER_TABLE_NAME_FROM_TSFILE_MULTIPLE_TABLES
                 + tsFile.getAbsolutePath());
       }
       return tableSchemaMap.values().iterator().next();
@@ -180,7 +184,7 @@ final class TsFileSchemaCollector {
 
   private UDFArgumentNotValidException invalidTsFileException(File tsFile) {
     return new UDFArgumentNotValidException(
-        "File is not a valid TsFile: " + tsFile.getAbsolutePath());
+        DataNodeQueryMessages.FILE_IS_NOT_A_VALID_TSFILE + 
tsFile.getAbsolutePath());
   }
 
   private static class MergedTableSchemaBuilder {
@@ -207,7 +211,8 @@ final class TsFileSchemaCollector {
         if (currentCategory == ColumnCategory.TIME) {
           if (currentTimeColumn != null) {
             throw new UDFArgumentNotValidException(
-                "Multiple time columns found when merging table schema for 
table " + tableName);
+                
DataNodeQueryMessages.MULTIPLE_TIME_COLUMNS_FOUND_WHEN_MERGING_TABLE_SCHEMA
+                    + tableName);
           }
           currentTimeColumn = columnSchemas.get(i);
         } else if (currentCategory == ColumnCategory.TAG) {
@@ -235,7 +240,7 @@ final class TsFileSchemaCollector {
       if 
(!timeColumnSchema.getMeasurementName().equals(currentTimeColumn.getMeasurementName())
           || currentTimeColumn.getType() != TSDataType.TIMESTAMP) {
         throw new UDFArgumentNotValidException(
-            "Time column conflicts when merging table schema for table " + 
tableName);
+            
DataNodeQueryMessages.TIME_COLUMN_CONFLICTS_WHEN_MERGING_TABLE_SCHEMA + 
tableName);
       }
     }
 
@@ -247,7 +252,7 @@ final class TsFileSchemaCollector {
             .getMeasurementName()
             .equals(currentTagColumns.get(i).getMeasurementName())) {
           throw new UDFArgumentNotValidException(
-              "Tag columns conflict when merging table schema for table " + 
tableName);
+              
DataNodeQueryMessages.TAG_COLUMNS_CONFLICT_WHEN_MERGING_TABLE_SCHEMA + 
tableName);
         }
       }
       tagColumnSchemas.addAll(currentTagColumns.subList(prefixLength, 
currentTagColumns.size()));
@@ -260,10 +265,11 @@ final class TsFileSchemaCollector {
         if (existingColumn != null
             && !existingColumn.getType().isCompatible(fieldColumn.getType())) {
           throw new UDFArgumentNotValidException(
-              "Field column "
-                  + fieldColumn.getMeasurementName()
-                  + " has conflicting data types when merging table schema for 
table "
-                  + tableName);
+              String.format(
+                  DataNodeQueryMessages
+                      
.FIELD_COLUMN_HAS_CONFLICTING_DATA_TYPES_WHEN_MERGING_TABLE_SCHEMA,
+                  fieldColumn.getMeasurementName(),
+                  tableName));
         }
         fieldColumnSchemaMap.putIfAbsent(fieldName, fieldColumn);
       }
@@ -275,10 +281,10 @@ final class TsFileSchemaCollector {
       ColumnCategory existingCategory = columnCategoryMap.get(columnName);
       if (existingCategory != null && existingCategory != currentCategory) {
         throw new UDFArgumentNotValidException(
-            "Column "
-                + columnSchema.getMeasurementName()
-                + " has conflicting categories when merging table schema for 
table "
-                + tableName);
+            String.format(
+                
DataNodeQueryMessages.COLUMN_HAS_CONFLICTING_CATEGORIES_WHEN_MERGING_TABLE_SCHEMA,
+                columnSchema.getMeasurementName(),
+                tableName));
       }
       columnCategoryMap.putIfAbsent(columnName, currentCategory);
     }
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/RelationPlanner.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/RelationPlanner.java
index 54c239c0fef..5578b2bc7dd 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/RelationPlanner.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/RelationPlanner.java
@@ -1603,7 +1603,8 @@ public class RelationPlanner implements 
AstVisitor<RelationPlan, Void> {
       TableFunctionInvocation node, TableFunctionInvocationAnalysis 
functionAnalysis) {
     if (!(functionAnalysis.getTableFunctionHandle()
         instanceof ReadTsFileTableFunction.ReadTsFileTableFunctionHandle)) {
-      throw new IllegalStateException("readTsFile table function handle is 
invalid");
+      throw new IllegalStateException(
+          DataNodeQueryMessages.READ_TSFILE_TABLE_FUNCTION_HANDLE_IS_INVALID);
     }
 
     ReadTsFileTableFunction.ReadTsFileTableFunctionHandle handle =
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileAggregationScanNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileAggregationScanNode.java
index d3200ff987c..7996248d4ea 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileAggregationScanNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileAggregationScanNode.java
@@ -28,6 +28,7 @@ import 
org.apache.iotdb.commons.queryengine.plan.relational.planner.Symbol;
 import 
org.apache.iotdb.commons.queryengine.plan.relational.planner.node.AggregationNode;
 import org.apache.iotdb.commons.queryengine.plan.relational.sql.ast.Expression;
 import org.apache.iotdb.commons.schema.filter.SchemaFilter;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanVisitor;
 import 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile.ExternalTsFileQueryResource;
 import org.apache.iotdb.db.queryengine.plan.relational.metadata.DeviceEntry;
@@ -149,7 +150,8 @@ public class ExternalTsFileAggregationScanNode extends 
AggregationTableScanNode
   @Override
   public void setDeviceEntries(List<DeviceEntry> deviceEntries) {
     throw new UnsupportedOperationException(
-        "ExternalTsFileAggregationScanNode device entries must be set by 
device entry indexes");
+        DataNodeQueryMessages
+            
.EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES);
   }
 
   public SchemaFilter getSchemaFilter() {
@@ -163,13 +165,13 @@ public class ExternalTsFileAggregationScanNode extends 
AggregationTableScanNode
   @Override
   protected void serializeAttributes(ByteBuffer byteBuffer) {
     throw new UnsupportedOperationException(
-        "ExternalTsFileAggregationScanNode cannot be serialized because it 
reads local external TsFiles");
+        
DataNodeQueryMessages.EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_CANNOT_BE_SERIALIZED);
   }
 
   @Override
   protected void serializeAttributes(DataOutputStream stream) throws 
IOException {
     throw new UnsupportedOperationException(
-        "ExternalTsFileAggregationScanNode cannot be serialized because it 
reads local external TsFiles");
+        
DataNodeQueryMessages.EXTERNAL_TSFILE_AGGREGATION_SCAN_NODE_CANNOT_BE_SERIALIZED);
   }
 
   @Override
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileScanNode.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileScanNode.java
index d9f66d4aa93..fddcd3b66fa 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileScanNode.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/node/ExternalTsFileScanNode.java
@@ -26,6 +26,7 @@ import 
org.apache.iotdb.commons.queryengine.plan.relational.metadata.QualifiedOb
 import org.apache.iotdb.commons.queryengine.plan.relational.planner.Symbol;
 import org.apache.iotdb.commons.queryengine.plan.relational.sql.ast.Expression;
 import org.apache.iotdb.commons.schema.filter.SchemaFilter;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanVisitor;
 import 
org.apache.iotdb.db.queryengine.plan.relational.function.tvf.readTsFile.ExternalTsFileQueryResource;
 import org.apache.iotdb.db.queryengine.plan.relational.metadata.DeviceEntry;
@@ -140,7 +141,8 @@ public class ExternalTsFileScanNode extends 
DeviceTableScanNode {
   @Override
   public void setDeviceEntries(List<DeviceEntry> deviceEntries) {
     throw new UnsupportedOperationException(
-        "ExternalTsFileScanNode device entries must be set by device entry 
indexes");
+        DataNodeQueryMessages
+            
.EXTERNAL_TSFILE_SCAN_NODE_DEVICE_ENTRIES_MUST_BE_SET_BY_DEVICE_ENTRY_INDEXES);
   }
 
   public SchemaFilter getSchemaFilter() {
@@ -154,13 +156,13 @@ public class ExternalTsFileScanNode extends 
DeviceTableScanNode {
   @Override
   protected void serializeAttributes(ByteBuffer byteBuffer) {
     throw new UnsupportedOperationException(
-        "ExternalTsFileScanNode cannot be serialized because it reads local 
external TsFiles");
+        DataNodeQueryMessages.EXTERNAL_TSFILE_SCAN_NODE_CANNOT_BE_SERIALIZED);
   }
 
   @Override
   protected void serializeAttributes(DataOutputStream stream) throws 
IOException {
     throw new UnsupportedOperationException(
-        "ExternalTsFileScanNode cannot be serialized because it reads local 
external TsFiles");
+        DataNodeQueryMessages.EXTERNAL_TSFILE_SCAN_NODE_CANNOT_BE_SERIALIZED);
   }
 
   @Override
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
index 5ffac0473ba..3f5927e9bb8 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
@@ -55,6 +55,7 @@ import org.apache.iotdb.commons.schema.table.TsTable;
 import org.apache.iotdb.commons.schema.table.column.TagColumnSchema;
 import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.i18n.DataNodeQueryMessages;
 import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
 import org.apache.iotdb.db.queryengine.common.QueryId;
 import org.apache.iotdb.db.queryengine.metric.QueryPlanCostMetricSet;
@@ -580,7 +581,7 @@ public class PushPredicateIntoTableScan implements 
PlanOptimizer {
               new ConvertSchemaPredicateToFilterVisitor.Context(table));
       if (deviceFilter == null) {
         throw new UnsupportedOperationException(
-            "Unsupported external TsFile device filter: " + predicate);
+            DataNodeQueryMessages.UNSUPPORTED_EXTERNAL_TSFILE_DEVICE_FILTER + 
predicate);
       }
       return deviceFilter;
     }

Reply via email to