You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "MiniSho (via GitHub)" <gi...@apache.org> on 2025/03/03 09:04:36 UTC

[PR] Load: Support loading table Tsfile by load-tsfile.sh [iotdb]

MiniSho opened a new pull request, #15003:
URL: https://github.com/apache/iotdb/pull/15003

   ## Description
   add new configuration `-db` or `--database` to specify the database.
   


-- 
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-unsubscribe@iotdb.apache.org

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


Re: [PR] Load: Support loading table Tsfile by load-tsfile.sh [iotdb]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #15003:
URL: https://github.com/apache/iotdb/pull/15003#discussion_r2018058122


##########
iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ImportTsFileLocally.java:
##########
@@ -49,6 +53,18 @@ public void loadTsFile() {
     }
   }
 
+  private String buildLoadSql(String filePath) {
+    List<String> parameters = new ArrayList<>();
+    if (!verify) {
+      parameters.add(String.format("\"%s\"=false", VERIFY_KEY));
+    }
+    if (databaseName != null) {
+      parameters.add(String.format("\"%s\"=\"%s\"", DATABASE_NAME_KEY, databaseName));
+    }
+    String paramStr = String.join(",", parameters);
+    return String.format("load '%s' WITH (%s)", filePath, paramStr);

Review Comment:
   If both verify is true and databaseName is null, 'paramStr' may be empty resulting in an SQL statement with an empty WITH clause (i.e., WITH ()). Consider conditionally appending the WITH clause only when parameters are provided.
   ```suggestion
       if (paramStr.isEmpty()) {
         return String.format("load '%s'", filePath);
       } else {
         return String.format("load '%s' WITH (%s)", filePath, paramStr);
       }
   ```



-- 
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-unsubscribe@iotdb.apache.org

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


Re: [PR] Load: Support loading table Tsfile by load-tsfile.sh [iotdb]

Posted by "SteveYurongSu (via GitHub)" <gi...@apache.org>.
SteveYurongSu closed pull request #15003: Load: Support loading table Tsfile by load-tsfile.sh
URL: https://github.com/apache/iotdb/pull/15003


-- 
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-unsubscribe@iotdb.apache.org

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


Re: [PR] Load: Support loading table Tsfile by load-tsfile.sh [iotdb]

Posted by "Caideyipi (via GitHub)" <gi...@apache.org>.
Caideyipi commented on code in PR #15003:
URL: https://github.com/apache/iotdb/pull/15003#discussion_r2050187123


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java:
##########
@@ -545,8 +545,8 @@ protected String getSenderPort() {
   protected TSStatus loadFileV1(final PipeTransferFileSealReqV1 req, final String fileAbsolutePath)

Review Comment:
   Seems that "importTsFileRemotely" will also use loadFileV2?



##########
iotdb-client/cli/src/main/java/org/apache/iotdb/tool/tsfile/ImportTsFileLocally.java:
##########
@@ -34,11 +40,9 @@ public void loadTsFile() {
     String filePath;
     try {
       while ((filePath = ImportTsFileScanTool.pollFromQueue()) != null) {
-        final String sql =
-            "load '" + filePath + "' onSuccess=none " + (verify ? "" : "verify=false");
+        String sql = buildLoadSql(filePath);
         try {
           sessionPool.executeNonQueryStatement(sql);

Review Comment:
   Is the session sql dialect changed?



-- 
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-unsubscribe@iotdb.apache.org

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