You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ch...@apache.org on 2021/05/18 05:20:22 UTC

[iotdb] 01/01: Fix import csv throw ArrayOutOfIndexError when the last value in a line is null (#3185)

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

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

commit b7fd1c11a6733f85e85148b429f94f87e8d668e8
Author: Haimei Guo <68...@users.noreply.github.com>
AuthorDate: Fri May 14 15:05:54 2021 +0800

    Fix import csv throw ArrayOutOfIndexError when the last value in a line is null (#3185)
---
 cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java b/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
index b0d3075..6959360 100644
--- a/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
+++ b/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
@@ -435,6 +435,9 @@ public class ImportCsv extends AbstractCsvTool {
         nextNode(path, nodes, '\'');
       }
     }
+    if (path.charAt(path.length() - 1) == ',') {
+      nodes.add("");
+    }
     if (startIndex <= path.length() - 1) {
       nodes.add(path.substring(startIndex));
     }