[ https://issues.apache.org/jira/browse/SYSTEMML-654?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Dusenberry updated SYSTEMML-654: ------------------------------------- Assignee: Glenn Weidner > DML Functions Should Override Builtin Functions > ----------------------------------------------- > > Key: SYSTEMML-654 > URL: https://issues.apache.org/jira/browse/SYSTEMML-654 > Project: SystemML > Issue Type: Sub-task > Affects Versions: SystemML 0.10 > Reporter: Mike Dusenberry > Assignee: Glenn Weidner > > Currently, if a user defines a DML-bodied function that has the same name as > a builtin function, an error will be returned. This occurs both if the > function is defined in the same file as it is being called (which could look > like a builtin function call, although the user does not wish it to be), or > if the function is defined in a separate file and called with a namespace > notation. As we grow the language with an increasing number of builtin > functions, this is not the desired behavior. Instead, any DML functions > should override any builtin functions. > Example 1: > {code} > min = function(int i) { > print("hi" + i) > } > tmp = min(1) # fail! > {code} > {code} > : org.apache.sysml.parser.LanguageException: Unsupported Parameters : ERROR: > null -- line 6, column 0 -- Expecting matrix parameter for function MIN > at > org.apache.sysml.parser.Expression.raiseValidateError(Expression.java:421) > at > org.apache.sysml.parser.BuiltinFunctionExpression.checkMatrixParam(BuiltinFunctionExpression.java:1221) > at > org.apache.sysml.parser.BuiltinFunctionExpression.validateExpression(BuiltinFunctionExpression.java:314) > at > org.apache.sysml.parser.StatementBlock.validate(StatementBlock.java:598) > at > org.apache.sysml.parser.DMLTranslator.validateParseTree(DMLTranslator.java:136) > at > org.apache.sysml.api.MLContext.executeUsingSimplifiedCompilationChain(MLContext.java:1325) > at > org.apache.sysml.api.MLContext.compileAndExecuteScript(MLContext.java:1227) > at org.apache.sysml.api.MLContext.executeScript(MLContext.java:1165) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231) > at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381) > at py4j.Gateway.invoke(Gateway.java:259) > at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133) > at py4j.commands.CallCommand.execute(CallCommand.java:79) > at py4j.GatewayConnection.run(GatewayConnection.java:209) > at java.lang.Thread.run(Thread.java:745) > {code} > Example 2: > {code} > # util.dml > min = function(int i) { > print("hi" + i) > } > {code} > {code} > source("util.dml") as util > tmp = util::min(1) # fail! > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)