You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by GitBox <gi...@apache.org> on 2022/08/30 15:15:40 UTC

[GitHub] [incubator-hugegraph-toolchain] javeme commented on a diff in pull request #326: fix: Line fetch some value null

javeme commented on code in PR #326:
URL: https://github.com/apache/incubator-hugegraph-toolchain/pull/326#discussion_r958616288


##########
hugegraph-loader/src/main/java/com/baidu/hugegraph/loader/reader/file/OrcFileLineFetcher.java:
##########
@@ -123,11 +123,18 @@ public Line fetch() throws IOException {
         if (!this.recordReader.hasNext()) {
             return null;
         }
-
+        Object[] values = null;
         this.row = this.recordReader.next(this.row);
-        Object[] values = this.inspector.getStructFieldsDataAsList(this.row)
-                                        .stream().map(Object::toString)
-                                        .toArray();
+        try {
+            values = this.inspector.getStructFieldsDataAsList(this.row)
+                    .stream()
+                    .map(o -> o != null ? o.toString() : "")
+                    .toArray();
+        } catch (NullPointerException e) {

Review Comment:
   I think it won't throw NullPointerException if we translated null to "", right?



-- 
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: commits-unsubscribe@hugegraph.apache.org

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