[ 
https://issues.apache.org/jira/browse/SYSTEMML-658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Janardhan reassigned SYSTEMML-658:
----------------------------------

    Assignee: Janardhan

> Setting scalar strings not automatically treated as strings by JMLC
> -------------------------------------------------------------------
>
>                 Key: SYSTEMML-658
>                 URL: https://issues.apache.org/jira/browse/SYSTEMML-658
>             Project: SystemML
>          Issue Type: Bug
>            Reporter: Deron Eriksson
>            Assignee: Janardhan
>            Priority: Minor
>
> When using JMLC to set scalar string values, the values are not automatically 
> treated as strings as a result of calling setScalar with a string value.
> For example, take the following DML:
> {code}
> inScalar1 = read("./tmp/doesntexist1", data_type="scalar", 
> value_type="string");
> inScalar2 = read("./tmp/doesntexist2", data_type="scalar", 
> value_type="string");
> print(inScalar1 + inScalar2);
> {code}
> The above will be treated correctly. However, the following won't be treated 
> correctly:
> {code}
> inScalar1 = read("./tmp/doesntexist1", data_type="scalar");
> inScalar2 = read("./tmp/doesntexist2", data_type="scalar");
> print(inScalar1 + inScalar2);
> {code}
> (this will output "0.0")
> Calling PreparedScript's setScalar with a String should automatically resolve 
> to a String.
> {code}
> Connection conn = new Connection();
> String str = conn.readScript("scalar-input-string.dml");
> PreparedScript script = conn.prepareScript(str, new String[] { "inScalar1", 
> "inScalar2" }, new String[] {},
>               false);
> String inScalar1 = "hello";
> String inScalar2 = "goodbye";
> script.setScalar("inScalar1", inScalar1);
> script.setScalar("inScalar2", inScalar2);
> script.executeScript();
> {code}
> This should produce "hellogoodbye" rather than "0.0" with both DML examples.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to