Skip to content

Commit

Permalink
micro
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Oct 21, 2024
1 parent 7077bd7 commit a66e109
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,14 @@ protected final int readCSVFrameFromInputSplit(InputSplit split, InputFormat<Lon
if(naValues != null )
f = FrameReaderTextCSV::assignCellGeneric;
else if(isFill && dfillValue != 0)
f = FrameReaderTextCSV::assignCellFill;
else
f = FrameReaderTextCSV::assignCellNoFill;
else
f = FrameReaderTextCSV::assignCellNoNa;

// (int row, Array<?> dest, String val, int length, Set<String> naValues, boolean isFill,
// double dfillValue, String sfillValue, int col) ->{};
// create record reader
RecordReader<LongWritable, Text> reader = informat.getRecordReader(split, job, Reporter.NULL);
LongWritable key = new LongWritable();
Text value = new Text();
int row = rl;
final RecordReader<LongWritable, Text> 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) {
Expand Down Expand Up @@ -224,7 +221,19 @@ void assign(int row, Array<?> dest, String val, int length, Set<String> naValues
double dfillValue, String sfillValue, int col);
}


private static void assignCellNoFill(int row, Array<?> dest, String val, int length, Set<String> 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<String> naValues, boolean isFill,
double dfillValue, String sfillValue, int col) {
if(length == 0){
dest.set(row, sfillValue);
Expand Down

0 comments on commit a66e109

Please sign in to comment.