-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null Fastval should not output as 0 when used as numeric values #84
Labels
Comments
I imagine explicitly handling NULL and other special values in comparisons would probably be a valid implementation here. I'm not against the proposed alternative though. |
You should leave this issue open, as I know you mentioned that you will likely improve the implementation of this to correctly special-case null values. |
Hmm I forgot GitHub auto closes issues. Reopening now. |
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Jul 18, 2019
- Add valid comparison between null/non-null values or missing/not-missing values - Fix matcher Reset() where it wipes out old slots - Added new test data
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Jul 18, 2019
- Add valid comparison between null/non-null values or missing/not-missing values - Fix matcher Reset() where it wipes out old slots - Added new test data
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Jul 18, 2019
- Add valid comparison between null/non-null values or missing/not-missing values - Fix matcher Reset() where it wipes out old slots - Added new test data
Merged
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 1, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 11, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 24, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 28, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 28, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
nelio2k
added a commit
to nelio2k/gojsonsm
that referenced
this issue
Oct 28, 2019
…ensure that invalid type comparisons will result in a resolve state that is neither true nor false. This will help ensure a more well-defined matcher behavior and easier to be documented and understood. Based on the validity component, null comparisons (Issue couchbaselabs#84) can now be addressed correctly without the use of workarounds such as math.MaxUint or the like.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now a
NullValue
Fastval
outputs to0
or0.0
when itsAsUint()/AsInt()/AsFloat64()
is called.Since 0 is commonly used as values, it could easily lead to an incorrect match. Consider the following test case that incorrectly matches:
fieldpath.path
is not null in this case but because the nil value on the right side ofEqualsExpr
inserted by the parser equates to 0 when matches with LHS's 0(int), this evaluation results in the incorrect value.The simplest way to do it IMO is to make
NullValue
outputMinInt64/MaxUint64/MaxFloat64
whenAsInt()/AsUint()/AsFloat()
is called. Chances are, those values are unlikely to exist in real world scenarios.Another option is to do more complicated checks in
CompareOp
, which is more correct, but that will break the pretty symmetric function of the current code.Thoughts, @brett19 ?
The text was updated successfully, but these errors were encountered: