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

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


The following commit(s) were added to refs/heads/master by this push:
     new b3ef333  [MINOR] cleanup map built-in
b3ef333 is described below

commit b3ef333a164a279abeccad50ca0fab268a308a3e
Author: Shafaq Siddiqi <[email protected]>
AuthorDate: Tue Sep 1 12:23:38 2020 +0200

    [MINOR] cleanup map built-in
---
 docs/site/dml-language-reference.md                               | 8 ++++----
 src/main/java/org/apache/sysds/common/Types.java                  | 2 +-
 .../java/org/apache/sysds/runtime/functionobjects/Builtin.java    | 4 ++--
 .../apache/sysds/runtime/instructions/CPInstructionParser.java    | 2 +-
 .../apache/sysds/runtime/instructions/SPInstructionParser.java    | 2 +-
 .../apache/sysds/test/functions/binary/frame/FrameMapTest.java    | 2 +-
 src/test/scripts/functions/binary/frame/{dmlMap.dml => map.dml}   | 0
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/docs/site/dml-language-reference.md 
b/docs/site/dml-language-reference.md
index f5d9700..d3effda 100644
--- a/docs/site/dml-language-reference.md
+++ b/docs/site/dml-language-reference.md
@@ -2026,13 +2026,13 @@ The following example uses 
<code>transformapply()</code> with the input matrix a
 
 ### Processing Frames
 
-Built-In functions <code>dml_map()</code> is supported for frames to execute 
any arbitrary Java code on a frame.
+The built-in function <code>map()</code> provides support for the lambda 
expressions.
 
-**Table F5**: Frame dml_map Built-In Function
+**Table F5**: Frame map built-in function
 
 Function | Description | Parameters | Example
 -------- | ----------- | ---------- | -------
-dml_map() | It will execute the given java code on a frame (column-vector).| 
Input: (X &lt;frame&gt;, y &lt;String&gt;) <br/>Output: &lt;frame&gt;. <br/> X 
is a frame and y is a String containing the Java code to be executed on frame 
X. where X is a column vector. | X = read("file1", data_type="frame", rows=2, 
cols=3, format="binary") <br/> y = "Java code" <br/> Z = dml_map(X, y) <br/> # 
Dimensions of Z = Dimensions of X; <br/> example: Z = dml_map(X, "x.charAt(2)")
+map() | It will execute the given lambda expression on a frame.| Input: (X 
&lt;frame&gt;, y &lt;String&gt;) <br/>Output: &lt;frame&gt;. <br/> X is a frame 
and y is a String containing the lambda expression to be executed on frame X. | 
X = read("file1", data_type="frame", rows=2, cols=3, format="binary") <br/> y = 
"lambda expression" <br/> Z = map(X, y) <br/> # Dimensions of Z = Dimensions of 
X; <br/> example: Z = map(X, "x -> x.charAt(2)")
 Example let X = 
 
  ##### FRAME: nrow = 10, ncol = 1 <br/>
@@ -2049,7 +2049,7 @@ Example let X =
     west
     east  
 
-Z = dml_map(X, "x.toUpperCase()") <br/>
+Z = map(X, "x -> x.toUpperCase()") <br/>
 print(toString(Z))
  ##### FRAME: nrow = 10, ncol = 1 <br/>
     # C1 
diff --git a/src/main/java/org/apache/sysds/common/Types.java 
b/src/main/java/org/apache/sysds/common/Types.java
index 651214e..baa7c87 100644
--- a/src/main/java/org/apache/sysds/common/Types.java
+++ b/src/main/java/org/apache/sysds/common/Types.java
@@ -317,7 +317,7 @@ public class Types
                                case BITWSHIFTR:   return "bitwShiftR";
                                case DROP_INVALID_TYPE: return 
"dropInvalidType";
                                case DROP_INVALID_LENGTH: return 
"dropInvalidLength";
-                               case MAP:          return "dml_map";
+                               case MAP:          return "_map";
                                default:           return name().toLowerCase();
                        }
                }
diff --git 
a/src/main/java/org/apache/sysds/runtime/functionobjects/Builtin.java 
b/src/main/java/org/apache/sysds/runtime/functionobjects/Builtin.java
index 3022c5d..8ff29ec 100644
--- a/src/main/java/org/apache/sysds/runtime/functionobjects/Builtin.java
+++ b/src/main/java/org/apache/sysds/runtime/functionobjects/Builtin.java
@@ -50,7 +50,7 @@ public class Builtin extends ValueFunction
        public enum BuiltinCode { SIN, COS, TAN, SINH, COSH, TANH, ASIN, ACOS, 
ATAN, LOG, LOG_NZ, MIN,
                MAX, ABS, SIGN, SQRT, EXP, PLOGP, PRINT, PRINTF, NROW, NCOL, 
LENGTH, LINEAGE, ROUND, MAXINDEX, MININDEX,
                STOP, CEIL, FLOOR, CUMSUM, CUMPROD, CUMMIN, CUMMAX, CUMSUMPROD, 
INVERSE, SPROP, SIGMOID, EVAL, LIST,
-               TYPEOF, DETECTSCHEMA, ISNA, ISNAN, ISINF, DROP_INVALID_TYPE, 
DROP_INVALID_LENGTH, DML_MAP,
+               TYPEOF, DETECTSCHEMA, ISNA, ISNAN, ISINF, DROP_INVALID_TYPE, 
DROP_INVALID_LENGTH, MAP,
                COUNT_DISTINCT, COUNT_DISTINCT_APPROX}
 
 
@@ -107,7 +107,7 @@ public class Builtin extends ValueFunction
                String2BuiltinCode.put( "isinf", BuiltinCode.ISINF);
                String2BuiltinCode.put( "dropInvalidType", 
BuiltinCode.DROP_INVALID_TYPE);
                String2BuiltinCode.put( "dropInvalidLength", 
BuiltinCode.DROP_INVALID_LENGTH);
-               String2BuiltinCode.put( "dml_map", BuiltinCode.DML_MAP);
+               String2BuiltinCode.put( "_map", BuiltinCode.MAP);
        }
        
        private Builtin(BuiltinCode bf) {
diff --git 
a/src/main/java/org/apache/sysds/runtime/instructions/CPInstructionParser.java 
b/src/main/java/org/apache/sysds/runtime/instructions/CPInstructionParser.java
index f8a2636..82a604e 100644
--- 
a/src/main/java/org/apache/sysds/runtime/instructions/CPInstructionParser.java
+++ 
b/src/main/java/org/apache/sysds/runtime/instructions/CPInstructionParser.java
@@ -154,7 +154,7 @@ public class CPInstructionParser extends InstructionParser
                String2CPInstructionType.put( "min"  , CPType.Binary);
                String2CPInstructionType.put( "dropInvalidType"  , 
CPType.Binary);
                String2CPInstructionType.put( "dropInvalidLength"  , 
CPType.Binary);
-               String2CPInstructionType.put( "dml_map"  , CPType.Binary);
+               String2CPInstructionType.put( "_map"  , CPType.Binary); // _map 
represents the operation map
 
                String2CPInstructionType.put( "nmax", CPType.BuiltinNary);
                String2CPInstructionType.put( "nmin", CPType.BuiltinNary);
diff --git 
a/src/main/java/org/apache/sysds/runtime/instructions/SPInstructionParser.java 
b/src/main/java/org/apache/sysds/runtime/instructions/SPInstructionParser.java
index 42bf6f9..70512ec 100644
--- 
a/src/main/java/org/apache/sysds/runtime/instructions/SPInstructionParser.java
+++ 
b/src/main/java/org/apache/sysds/runtime/instructions/SPInstructionParser.java
@@ -179,7 +179,7 @@ public class SPInstructionParser extends InstructionParser
                String2SPInstructionType.put( "map-*",    SPType.Binary);
                String2SPInstructionType.put( "dropInvalidType", SPType.Binary);
                String2SPInstructionType.put( "mapdropInvalidLength", 
SPType.Binary);
-               String2SPInstructionType.put( "dml_map", SPType.Binary);
+               String2SPInstructionType.put( "_map", SPType.Binary); // _map 
refers to the operation map
                // Relational Instruction Opcodes
                String2SPInstructionType.put( "=="   , SPType.Binary);
                String2SPInstructionType.put( "!="   , SPType.Binary);
diff --git 
a/src/test/java/org/apache/sysds/test/functions/binary/frame/FrameMapTest.java 
b/src/test/java/org/apache/sysds/test/functions/binary/frame/FrameMapTest.java
index db5e0ef..c640659 100644
--- 
a/src/test/java/org/apache/sysds/test/functions/binary/frame/FrameMapTest.java
+++ 
b/src/test/java/org/apache/sysds/test/functions/binary/frame/FrameMapTest.java
@@ -33,7 +33,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class FrameMapTest extends AutomatedTestBase {
-       private final static String TEST_NAME = "dmlMap";
+       private final static String TEST_NAME = "map";
        private final static String TEST_DIR = "functions/binary/frame/";
        private static final String TEST_CLASS_DIR = TEST_DIR + 
FrameMapTest.class.getSimpleName() + "/";
 
diff --git a/src/test/scripts/functions/binary/frame/dmlMap.dml 
b/src/test/scripts/functions/binary/frame/map.dml
similarity index 100%
rename from src/test/scripts/functions/binary/frame/dmlMap.dml
rename to src/test/scripts/functions/binary/frame/map.dml

Reply via email to