[GitHub] incubator-metron pull request #404: METRON-624: Updated Comparison/Equality ...

2017-01-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-metron/pull/404


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-metron pull request #404: METRON-624: Updated Comparison/Equality ...

2016-12-23 Thread jjmeyer0
GitHub user jjmeyer0 opened a pull request:

https://github.com/apache/incubator-metron/pull/404

METRON-624: Updated Comparison/Equality Evaluations in Stellar

1. General cleanup in Stellar.g4
- Refactored the grammar to consistently use fragments instead of inlining 
things.

2. Updated the way Stellar transformations were validated
- Previously Stellar parsed/evaluated the transformation to validate it. In 
certain circumstances this would cause failures. For instances, all variables 
would be resolved to null which would cause an error to be thrown when 
evaluating transformations such as: '1 < foo', '1 < null'. Both of these 
statements are syntactically valid.
- Now the validation just checks whether the Stellar transformation is 
syntactically valid. It will not send the transformation through the listener 
as it once did. It will not validate that variables are defined. It will not 
validate functions are defined.

3. Updated comparison/equality expression evaluation
- Number 2 was required in order to update the comparison/equality 
evaluation.
- Now statements such as 1 == '1' will return false.
- When comparing numerical values, the standard promotion rules apply 
(http://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.6.2).
- When comparing non-numeric types, compareTo method is used.
- When either side is null then '==' and '!=' are used. For all other 
comparison operators null value would throw exception.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jjmeyer0/incubator-metron METRON-624

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-metron/pull/404.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #404


commit c1a9a25615f2a4bc09f6c0f2eb0b8b127d1ea2ef
Author: JJ 
Date:   2016-12-23T18:23:18Z

METRON-624: Updated Stellar to handle comparison/equality properly. These 
are broken up into a few categories: null comparisons, numerical comparisons, 
others types that can be compared, otherwise exception occurs.

commit c0cc0bdcdaa16cbd1d19203dda722316a6a4ffb9
Author: JJ 
Date:   2016-12-23T21:02:35Z

Updated the way a Stellar transformation is validated. Before this update 
the listener was used to validate the Stellar transformation expression. This 
would cause issues because the variable map wasn't be passed in causing all 
variables to resolve to null which would potentially cause a failure. 
Particularly when trying to validate expressions such as 'null < 1' which is 
syntactically valid, but semantically may not be. This commit updates the 
validation to say whether the rule is syntactically valid. It does not try to 
interpret anything. It just says whether the rule conforms to the Stellar 
grammar or not.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---