Skip to content

Commit

Permalink
maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
Baunsgaard committed Oct 21, 2024
1 parent 88c6bea commit 3d1a7a0
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/main/java/org/apache/sysds/runtime/io/FrameReaderTextCSV.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,25 @@ private boolean assignColumnsGeneric(int row, int nCol, Array<?>[] destA, Strin
boolean isFill, double dfillValue, String sfillValue) {
boolean emptyValuesFound = false;
for(int col = 0; col < nCol; col++) {
String part = IOUtilFunctions.trim(parts[col]);
if(part == null || part.isEmpty() || (naValues != null && naValues.contains(part))) {
if(isFill && dfillValue != 0)
destA[col].set(row, sfillValue);
emptyValuesFound = true;
}
else
destA[col].set(row, part);
emptyValuesFound = assignCellGeneric(row, destA, parts, naValues, isFill, dfillValue, sfillValue, emptyValuesFound, col);
}

return emptyValuesFound;
}

private boolean assignCellGeneric(int row, Array<?>[] destA, String[] parts, Set<String> naValues, boolean isFill,
double dfillValue, String sfillValue, boolean emptyValuesFound, int col) {
String part = IOUtilFunctions.trim(parts[col]);
if(part == null || part.isEmpty() || (naValues != null && naValues.contains(part))) {
if(isFill && dfillValue != 0)
destA[col].set(row, sfillValue);
emptyValuesFound = true;
}
else
destA[col].set(row, part);
return emptyValuesFound;
}

private boolean assignColumnsNoFillNoNan(int row, int nCol, Array<?>[] destA, String[] parts){

boolean emptyValuesFound = false;
Expand Down

0 comments on commit 3d1a7a0

Please sign in to comment.