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

arnabp20 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 e32c323537 [SYSTEMDS-3010] Add missing lineage support for list 
operations
e32c323537 is described below

commit e32c32353739f23d44febd97e347d6295a68089e
Author: Arnab Phani <[email protected]>
AuthorDate: Thu Jan 23 11:14:33 2025 +0100

    [SYSTEMDS-3010] Add missing lineage support for list operations
    
    This patch adds a missing lineage support for list creation from Eval,
    which was leading to a NullPointerException for topk cleaning.
---
 .../sysds/runtime/instructions/cp/EvalNaryCPInstruction.java   | 10 +++++++++-
 .../org/apache/sysds/runtime/lineage/LineageCacheConfig.java   |  4 +++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/instructions/cp/EvalNaryCPInstruction.java
 
b/src/main/java/org/apache/sysds/runtime/instructions/cp/EvalNaryCPInstruction.java
index 9f151e14cf..2b3eda8132 100644
--- 
a/src/main/java/org/apache/sysds/runtime/instructions/cp/EvalNaryCPInstruction.java
+++ 
b/src/main/java/org/apache/sysds/runtime/instructions/cp/EvalNaryCPInstruction.java
@@ -199,7 +199,15 @@ public class EvalNaryCPInstruction extends 
BuiltinNaryCPInstruction {
                        Data[] ldata = boundOutputNames.stream()
                                .map(n -> 
ec.getVariable(n)).toArray(Data[]::new);
                        String[] lnames = boundOutputNames.toArray(new 
String[0]);
-                       ListObject listOutput = new ListObject(ldata, lnames);
+                       ListObject listOutput = null;
+                       if (DMLScript.LINEAGE) {
+                               CPOperand[] listOperands = 
boundOutputNames.stream().map(n -> ec.containsVariable(n) ? new CPOperand(n,
+                                       ec.getVariable(n)) : new CPOperand(n, 
ValueType.STRING, DataType.SCALAR, true)).toArray(CPOperand[]::new);
+                               LineageItem[] liList = 
LineageItemUtils.getLineage(ec, listOperands);
+                               listOutput = new 
ListObject(Arrays.asList(ldata), boundOutputNames, Arrays.asList(liList));
+                       }
+                       else
+                               listOutput = new ListObject(ldata, lnames);
                        ec.setVariable(output.getName(), listOutput);
                }
                
diff --git 
a/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java 
b/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
index b700410f62..93b941eb92 100644
--- a/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
+++ b/src/main/java/org/apache/sysds/runtime/lineage/LineageCacheConfig.java
@@ -32,6 +32,7 @@ import 
org.apache.sysds.runtime.instructions.cp.BinaryScalarScalarCPInstruction;
 import org.apache.sysds.runtime.instructions.cp.ComputationCPInstruction;
 import org.apache.sysds.runtime.instructions.cp.Data;
 import org.apache.sysds.runtime.instructions.cp.DataGenCPInstruction;
+import org.apache.sysds.runtime.instructions.cp.FrameIndexingCPInstruction;
 import org.apache.sysds.runtime.instructions.cp.ListIndexingCPInstruction;
 import org.apache.sysds.runtime.instructions.cp.MatrixIndexingCPInstruction;
 import org.apache.sysds.runtime.instructions.fed.ComputationFEDInstruction;
@@ -268,7 +269,8 @@ public class LineageCacheConfig
                        || inst instanceof GPUInstruction
                        || inst instanceof ComputationSPInstruction)
                        && !(inst instanceof ListIndexingCPInstruction)
-                       && !(inst instanceof BinaryScalarScalarCPInstruction);
+                       && !(inst instanceof BinaryScalarScalarCPInstruction)
+                       && !(inst instanceof FrameIndexingCPInstruction);
                boolean rightCPOp = (ArrayUtils.contains(REUSE_OPCODES, 
inst.getOpcode())
                        || (inst.getOpcode().equals("append") && 
isVectorAppend(inst, ec))
                        || (inst.getOpcode().startsWith("spoof"))

Reply via email to