You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2025/08/09 11:02:46 UTC

(systemds) branch main updated: [SYSTEMDS-3900] Fix corrupted I/O path for non-binary formats

This is an automated email from the ASF dual-hosted git repository.

mboehm7 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new a61919e04b [SYSTEMDS-3900] Fix corrupted I/O path for non-binary formats
a61919e04b is described below

commit a61919e04bf2a78bbeb189f626423bcebc7ec8b6
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Sat Aug 9 13:02:19 2025 +0200

    [SYSTEMDS-3900] Fix corrupted I/O path for non-binary formats
---
 .../sysds/runtime/instructions/cp/VariableCPInstruction.java      | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sysds/runtime/instructions/cp/VariableCPInstruction.java b/src/main/java/org/apache/sysds/runtime/instructions/cp/VariableCPInstruction.java
index d3be925027..5dd8e55e82 100644
--- a/src/main/java/org/apache/sysds/runtime/instructions/cp/VariableCPInstruction.java
+++ b/src/main/java/org/apache/sysds/runtime/instructions/cp/VariableCPInstruction.java
@@ -1060,9 +1060,6 @@ public class VariableCPInstruction extends CPInstruction implements LineageTrace
 			HDFSTool.writeScalarToHDFS(ec.getScalarInput(getInput1()), fname);
 		}
 		else if( getInput1().getDataType() == DataType.MATRIX ) {
-			MatrixObject mo = ec.getMatrixObject(getInput1().getName());
-			int blen = Integer.parseInt(getInput4().getName());
-
 			if( fmt == FileFormat.MM )
 				writeMMFile(ec, fname);
 			else if( fmt == FileFormat.CSV )
@@ -1071,8 +1068,9 @@ public class VariableCPInstruction extends CPInstruction implements LineageTrace
 				writeLIBSVMFile(ec, fname);
 			else if(fmt == FileFormat.HDF5)
 				writeHDF5File(ec, fname);
-			else {
-				// Default behavior (text, binary)
+			else { // Default behavior (text, binary)
+				MatrixObject mo = ec.getMatrixObject(getInput1().getName());
+				int blen = Integer.parseInt(getInput4().getName());
 				mo.exportData(fname, fmtStr, new FileFormatProperties(blen));
 			}
 		}