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 <[email protected]>
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));
                        }
                }

Reply via email to