You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by zh...@apache.org on 2022/08/03 03:56:11 UTC
[incubator-hugegraph-toolchain] branch fix-orc-reader-npe created (now 5915301)
This is an automated email from the ASF dual-hosted git repository.
zhangyi89817 pushed a change to branch fix-orc-reader-npe
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git
at 5915301 Fix orc data import npe
This branch includes the following new commits:
new 5915301 Fix orc data import npe
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[incubator-hugegraph-toolchain] 01/01: Fix orc data import npe
Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zhangyi89817 pushed a commit to branch fix-orc-reader-npe
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-toolchain.git
commit 5915301e3f377445e80408bc1978fa5a666dbf01
Author: zhangyi51 <zh...@baidu.com>
AuthorDate: Wed Aug 3 11:55:16 2022 +0800
Fix orc data import npe
Co-authored-by: ss <50...@users.noreply.github.com>
Change-Id: I13a0d663adead9b7ee66af62238c6769350ebdff
---
.../hugegraph/loader/reader/file/OrcFileLineFetcher.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/baidu/hugegraph/loader/reader/file/OrcFileLineFetcher.java b/src/main/java/com/baidu/hugegraph/loader/reader/file/OrcFileLineFetcher.java
index 6354548..c7f4b7c 100644
--- a/src/main/java/com/baidu/hugegraph/loader/reader/file/OrcFileLineFetcher.java
+++ b/src/main/java/com/baidu/hugegraph/loader/reader/file/OrcFileLineFetcher.java
@@ -124,9 +124,15 @@ public class OrcFileLineFetcher extends FileLineFetcher {
}
this.row = this.recordReader.next(this.row);
- Object[] values = this.inspector.getStructFieldsDataAsList(this.row)
- .stream().map(Object::toString)
- .toArray();
+ List<Object> data = this.inspector.getStructFieldsDataAsList(this.row);
+ Object[] values = new Object[data.size()];
+ for (int i = 0; i < data.size(); i++) {
+ if (data.get(i) == null) {
+ values[i] = "";
+ } else {
+ values[i] = data.get(i).toString();
+ }
+ }
String rawLine = StringUtils.join(values, Constants.COMMA_STR);
this.increaseOffset();