Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix delimiter is null
  • Loading branch information
alanzhao committed Aug 4, 2023
1 parent 5658a87 commit 841e774
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.slf4j.Logger;

import java.io.Serializable;
import java.util.Optional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
Expand Down Expand Up @@ -292,9 +293,13 @@ private void parse(Row row, Map.Entry<ElementBuilder, List<GraphElement>> builde
case FILE:
case HDFS:
FileSource fileSource = struct.input().asFileSource();
String delimiter = fileSource.delimiter();
elements = builder.build(fileSource.header(),
row.mkString(delimiter).split(delimiter));
String delimiter = fileSource.delimiter() ;
if (Optional.ofNullable(delimiter).isPresent()) {
elements = builder.build(fileSource.header(),
row.mkString(delimiter).split(delimiter));
}else {
elements = builder.build(row);
}
break;
case JDBC:
Object[] structFields = JavaConverters.asJavaCollection(row.schema().toList())
Expand Down

0 comments on commit 841e774

Please sign in to comment.