Skip to content

Commit a61919e

Browse files
committed
[SYSTEMDS-3900] Fix corrupted I/O path for non-binary formats
1 parent 44cd867 commit a61919e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main/java/org/apache/sysds/runtime/instructions/cp/VariableCPInstruction.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,6 @@ private void processWriteInstruction(ExecutionContext ec) {
10601060
HDFSTool.writeScalarToHDFS(ec.getScalarInput(getInput1()), fname);
10611061
}
10621062
else if( getInput1().getDataType() == DataType.MATRIX ) {
1063-
MatrixObject mo = ec.getMatrixObject(getInput1().getName());
1064-
int blen = Integer.parseInt(getInput4().getName());
1065-
10661063
if( fmt == FileFormat.MM )
10671064
writeMMFile(ec, fname);
10681065
else if( fmt == FileFormat.CSV )
@@ -1071,8 +1068,9 @@ else if(fmt == FileFormat.LIBSVM)
10711068
writeLIBSVMFile(ec, fname);
10721069
else if(fmt == FileFormat.HDF5)
10731070
writeHDF5File(ec, fname);
1074-
else {
1075-
// Default behavior (text, binary)
1071+
else { // Default behavior (text, binary)
1072+
MatrixObject mo = ec.getMatrixObject(getInput1().getName());
1073+
int blen = Integer.parseInt(getInput4().getName());
10761074
mo.exportData(fname, fmtStr, new FileFormatProperties(blen));
10771075
}
10781076
}

0 commit comments

Comments
 (0)