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

2017-01-12 Thread jjmeyer0
Github user jjmeyer0 commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
Thanks @cestella. I appreciate it. If no one has already, I'll work on 
those functions we discussed next.


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2017-01-11 Thread cestella
Github user cestella commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
Yeah, this is good work.  I looked at it again after my vacation and I like 
it.  I give it a +1.


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2017-01-09 Thread cestella
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.


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2016-12-26 Thread jjmeyer0
Github user jjmeyer0 commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
@cestella if comparing floats/doubles is going to be a common thing maybe 
we should provide a way to do so easily. Maybe we create functions 
FLOAT_EQUALS(f1, f2, epsilon) and DOUBLE_EQUALS(d1, d2, epsilon).


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2016-12-23 Thread jjmeyer0
Github user jjmeyer0 commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
@cestella I updated the comparison expressions to return false when either 
side is null. I'll work on the validation stuff soon. 


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2016-12-23 Thread cestella
Github user cestella commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
One further thought: regarding the validation, I just want to point out 
that I'd be ok for validation to not *execute* the statement, but only validate 
syntactic correctness and function existence.  It just means that we will need 
to augment `StellarProcessorUtils` to execute with a map that returns null for 
its variables to ensure our tests continue to cover the same way.

I do think we should retain the functionality that comparisons involving 
nulls operate in a sensible way.  I think any comparison involving `null` 
should return `false` sort of like how doubles function with `NaN`.  Also, the 
decisions made here should be included in the stellar section of the README.md 
as part of this PR.

I'm coming around about `==` operating strictly for doubles.  I could see 
how that would violate the principle of least surprise for people coming from 
other languages.  I guess I never had much use for `==` with `double`s and 
thought I could automatically save people some obvious errors, but I think the 
current approach is problematic and probably should be scrapped for what this 
PR does.


---
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 issue #404: METRON-624: Updated Comparison/Equality Evaluat...

2016-12-23 Thread cestella
Github user cestella commented on the issue:

https://github.com/apache/incubator-metron/pull/404
  
Hey, thanks for the great addition @jjmeyer0!

A few things to note and some context.

Around validation, the initial stellar implementation purposefully ran 
validation the way that it's implemented, but we can reconsider those things if 
we want.
* The variables resolve to `null` to ensure that functions could handle 
`null` without error.  I understand that Java and most programming languages 
would NPE on `1 < null`, but our data flowing through the topologies will be 
sparse, so not all variables will be defined for every message.  If a stellar 
statement is applied to a message where the variable is not defined, I wanted 
to ensure that it did not fail, but rather did an appropriate thing depending 
on the operation.
* We do function resolution during validation to ensure people have not 
made a syntactic error in their stellar statements when pushing configs to 
zookeeper.  We would rather fail fast here.

Around `==` for floating point numbers.  The initial stellar implementation 
intended to do an epsilon check on equals involving doubles (e.g. Math.abs(lhs 
- rhs) < epsilon) as you almost never want strict equality in floating point 
numbers.

What this does show is that we need more of a rigorous spec and more time 
spent on documenting the design of Stellar.


---
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.
---