From a66e109ecada2a28ef6bd8661ce6ec149d023605 Mon Sep 17 00:00:00 2001 From: Sebastian Baunsgaard Date: Mon, 21 Oct 2024 16:43:12 +0200 Subject: [PATCH] micro --- .../sysds/runtime/io/FrameReaderTextCSV.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) 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);