You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@metron.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/01/09 14:30:58 UTC

[jira] [Commented] (METRON-624) Comparison Operators Evaluate Incorrectly

    [ https://issues.apache.org/jira/browse/METRON-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15811902#comment-15811902 ] 

ASF GitHub Bot commented on METRON-624:
---------------------------------------

Github user cestella commented on the issue:

    https://github.com/apache/incubator-metron/pull/404
  
    @jjmeyer0 Yeah, I tend to agree.  I'll make a follow-on JIRA to add an `APPROX_EQUALS`.  I feel better about it now that we have an `ABS` function.


> Comparison Operators Evaluate Incorrectly
> -----------------------------------------
>
>                 Key: METRON-624
>                 URL: https://issues.apache.org/jira/browse/METRON-624
>             Project: Metron
>          Issue Type: Bug
>            Reporter: Josh Meyer
>              Labels: stellar
>
> Currently there is an issue with the way Stellar interprets comparison expressions. Currently it only compares numbers when both sides are numbers otherwise it converts both sides of the expression to a value and then compares them. Also, when looking at numbers it always gets double values to compare.
> Below is an example of a failing test that should pass.
> {code:theme=FadeToGrey|linenumbers=true|language=java|firstline=0001|collapse=false}
>   @Test
>   public void compareNumberAndStringWithSameValueShouldFail() throws Exception {
>     final Map<String, String> variableMap = new HashMap<>();
>     assertFalse(runPredicate("1 == '1'", variableMap::get));
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)