Skip to content

Commit

Permalink
Fix orc data import npe
Browse files Browse the repository at this point in the history
fixed: #319

Co-authored-by: ss <50285938+ssisme2019@users.noreply.github.com>
Change-Id: I13a0d663adead9b7ee66af62238c6769350ebdff
  • Loading branch information
zhoney and ssisme2019 committed Aug 3, 2022
1 parent 278fbea commit 786c99a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ public Line fetch() throws IOException {
}

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();
Expand Down

0 comments on commit 786c99a

Please sign in to comment.