diff --git a/src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java b/src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java index 5d9af6874ea..fd574fa5346 100644 --- a/src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java +++ b/src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java @@ -133,17 +133,14 @@ protected final int readCSVFrameFromInputSplit(InputSplit split, InputFormat dest, String val, int length, Set naValues, boolean isFill, - // double dfillValue, String sfillValue, int col) ->{}; - // create record reader - RecordReader reader = informat.getRecordReader(split, job, Reporter.NULL); - LongWritable key = new LongWritable(); - Text value = new Text(); - int row = rl; + final RecordReader reader = informat.getRecordReader(split, job, Reporter.NULL); + final LongWritable key = new LongWritable(); + final Text value = new Text(); + final int row = rl; // handle header if existing if(first && hasHeader) { @@ -224,7 +221,19 @@ void assign(int row, Array dest, String val, int length, Set naValues double dfillValue, String sfillValue, int col); } + private static void assignCellNoFill(int row, Array dest, String val, int length, Set naValues, boolean isFill, + double dfillValue, String sfillValue, int col) { + if(length != 0){ + final String part = IOUtilFunctions.trim(val, length); + if(part.isEmpty() ) + return; + dest.set(row, part); + } + } + + + private static void assignCellFill(int row, Array dest, String val, int length, Set naValues, boolean isFill, double dfillValue, String sfillValue, int col) { if(length == 0){ dest.set(row, sfillValue);