release: 1.0.0-alpha16 — fix int/double comparison (XPTY0004) via brackit 1.0-alpha2#1006
Merged
Merged
Conversation
…ble comparison fix) Document-sourced integers (stored as brackit Int64 by the JSON shredder) compared against document-sourced doubles threw err:XPTY0004 "Cannot compare 'xs:integer' with 'xs:double'", breaking `order by` and value comparisons over fields with mixed integer/double values. Root cause was in brackit: Int32/Int64 matched a double/float operand by its CONCRETE Dbl/Flt class rather than the DblNumeric/FltNumeric INTERFACE (decimals were already matched by interface), so a DblNumericJsonDBItem — which implements the interface but is not the concrete class — was mis-routed to the "Cannot compare" throw (and arithmetic narrowed to xs:float). Fixed in brackit (Int32/Int64 now dispatch on the numeric interfaces, like the base Int already does); this bumps the dependency to 1.0-alpha2-SNAPSHOT. Adds NumericComparisonRegressionTest guarding order-by/min/max/compare/arithmetic over mixed Int64 and double document-sourced numbers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Document-sourced integers — stored as brackit
Int64by the JSON shredder — compared against document-sourced doubles threwerr:XPTY0004 "Cannot compare 'xs:integer' with 'xs:double'", breakingorder byand value comparisons over fields with mixed integer/double values (e.g. aratingarray of3,3.7,4.4).Root cause (brackit) + fix
Int32/Int64matched a double/float operand by its concreteDbl/Fltclass instead of theDblNumeric/FltNumericinterface (decimals were already matched by interface). ADblNumericJsonDBItem— which implements the interface but is not the concrete class — was mis-routed to the "Cannot compare" throw, and arithmetic narrowed toxs:float.Fixed at the root in brackit (sirixdb/brackit#96):
Int32/Int64now dispatch on the numeric interfaces, exactly as the baseIntalready does. This PR bumps the brackit dependency to1.0-alpha2-SNAPSHOT.Tests
NumericComparisonRegressionTestguardsorder by/min/max/ comparison / arithmetic over mixedInt64andxs:doubledocument-sourced numbers (each case threw XPTY0004 before the brackit fix).