This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 8ff01204936 Async Load: Set the database name null when appropriate &
Enable auto-creation of the database by reading the isAutoCreateSchemaEnabled
flag from config (#15489)
8ff01204936 is described below
commit 8ff0120493625760f44a54b88b6ec5914f81ed37
Author: Zhenyu Luo <[email protected]>
AuthorDate: Tue May 13 16:05:52 2025 +0800
Async Load: Set the database name null when appropriate & Enable
auto-creation of the database by reading the isAutoCreateSchemaEnabled flag
from config (#15489)
---
.../load/active/ActiveLoadTsFileLoader.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
index 2bae3175ca0..8d9e53f4296 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadTsFileLoader.java
@@ -217,14 +217,20 @@ public class ActiveLoadTsFileLoader {
throws FileNotFoundException {
final LoadTsFileStatement statement = new
LoadTsFileStatement(filePair.getLeft());
final List<File> files = statement.getTsFiles();
- if (!files.isEmpty()) {
- final File parentFile = files.get(0).getParentFile();
- statement.setDatabase(parentFile == null ? "null" :
parentFile.getName());
- }
+
+ // It should be noted here that the instructions in this code block do not
need to use the
+ // DataBase, so the DataBase is assigned a value of null. If the DataBase
is used later, an
+ // exception will be thrown.
+ final File parentFile;
+ statement.setDatabase(
+ files.isEmpty() || (parentFile = files.get(0).getParentFile()) == null
+ ? null
+ : parentFile.getName());
statement.setDeleteAfterLoad(true);
statement.setConvertOnTypeMismatch(true);
statement.setVerifySchema(isVerify);
- statement.setAutoCreateDatabase(false);
+ statement.setAutoCreateDatabase(
+ IoTDBDescriptor.getInstance().getConfig().isAutoCreateSchemaEnabled());
return executeStatement(
filePair.getRight() ? new PipeEnrichedStatement(statement) :
statement, session);
}