Raymond Tay created SYSTEMML-2537:
-------------------------------------
Summary: Improve the consistency of predicates in "If-then-else"
expressions
Key: SYSTEMML-2537
URL: https://issues.apache.org/jira/browse/SYSTEMML-2537
Project: SystemML
Issue Type: Task
Components: Parser
Affects Versions: SystemML 0.13
Reporter: Raymond Tay
The predicate or conditional-expression in the evaluation of the
+If-expression+ allows literal numeral values to be part of the predicate. In
the parser, if it sees a literal value of *1* then it would be _true_ otherwise
it is _false_; however it is entirely plausible to extend that definition to
cover all values *> 0* to be _true_ otherwise values *< 0* will be interpreted
as _false_.
E.g. this should print *No!* but instead it prints "Yes!"
bq. scala> val s = dml(""" if(-42) print("Yes!") else print("No!") """)
bq. scala> ml.execute(s)
bq. Yes!
bq. SystemML Statistics:
bq. Total execution time: 0.012 sec.
bq. Number of executed Spark inst: 0.
bq.
bq. res0: org.apache.sysml.api.mlcontext.MLResults = None
--
This message was sent by Atlassian Jira
(v8.3.4#803005)