diff --git a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java index 8f653ddad13..4fd72742029 100644 --- a/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java +++ b/src/main/java/org/apache/sysds/runtime/frame/data/columns/Array.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Objects; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -936,12 +937,19 @@ public double[] minMax(int l, int u) { public void setM(Map map, AMapToData m, int i){ m.set(i, map.get(get(i)).intValue() - 1); } - + public void setM(Map map, int si, AMapToData m, int i) { - final T v = get(i); - if(v != null) - m.set(i, map.get(v).intValue() - 1); - else - m.set(i, si); + try{ + + final T v = get(i); + if(v != null) + m.set(i, map.get(v).intValue() - 1); + else + m.set(i, si); + } + catch(Exception e) { + String error = "expected: " + get(i) + " to be in map: " + map; + throw new RuntimeException(error, e); + } } }