Repository: incubator-systemml
Updated Branches:
  refs/heads/master 0b9d4e06f -> eb988781d


[SYSTEMML-555] Error handling common transformencode invocation issue

Transformencode is requires a multi-assignment statement (e.g.,
[X,M]=transformencode()) - this patch adds a more meaningful error
handling for the case where transformencode is called with a
single-assignment statement (e.g., X=transformencode(...)).

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/3c3d1a40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/3c3d1a40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/3c3d1a40

Branch: refs/heads/master
Commit: 3c3d1a40e2c98bd132febf2960b862e054073da3
Parents: 0b9d4e0
Author: Matthias Boehm <mbo...@us.ibm.com>
Authored: Thu Sep 22 12:58:11 2016 -0700
Committer: Matthias Boehm <mbo...@us.ibm.com>
Committed: Thu Sep 22 21:43:25 2016 -0700

----------------------------------------------------------------------
 .../sysml/parser/ParameterizedBuiltinFunctionExpression.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/3c3d1a40/src/main/java/org/apache/sysml/parser/ParameterizedBuiltinFunctionExpression.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/sysml/parser/ParameterizedBuiltinFunctionExpression.java
 
b/src/main/java/org/apache/sysml/parser/ParameterizedBuiltinFunctionExpression.java
index 90364d7..cce1d77 100644
--- 
a/src/main/java/org/apache/sysml/parser/ParameterizedBuiltinFunctionExpression.java
+++ 
b/src/main/java/org/apache/sysml/parser/ParameterizedBuiltinFunctionExpression.java
@@ -259,7 +259,13 @@ public class ParameterizedBuiltinFunctionExpression 
extends DataIdentifier
                        break;
                        
                default: //always unconditional (because unsupported operation)
-                       raiseValidateError("Unsupported parameterized function 
"+ getOpCode(), false, LanguageErrorCodes.INVALID_PARAMETERS);
+                       //handle common issue of transformencode
+                       if( 
getOpCode()==ParameterizedBuiltinFunctionOp.TRANSFORMENCODE )
+                               raiseValidateError("Parameterized function "+ 
getOpCode() +" requires a multi-assignment statement "
+                                               + "for data and metadata.", 
false, LanguageErrorCodes.UNSUPPORTED_EXPRESSION);
+                       else
+                               raiseValidateError("Unsupported parameterized 
function "+ getOpCode(), 
+                                               false, 
LanguageErrorCodes.UNSUPPORTED_EXPRESSION);
                }
                return;
        }

Reply via email to