Skip to content

release: 1.0.0-alpha16 — fix int/double comparison (XPTY0004) via brackit 1.0-alpha2#1006

Merged
JohannesLichtenberger merged 1 commit into
mainfrom
fix/numeric-dbitem-comparison
Jun 6, 2026
Merged

release: 1.0.0-alpha16 — fix int/double comparison (XPTY0004) via brackit 1.0-alpha2#1006
JohannesLichtenberger merged 1 commit into
mainfrom
fix/numeric-dbitem-comparison

Conversation

@JohannesLichtenberger

Copy link
Copy Markdown
Member

Summary

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 (e.g. a rating array of 3, 3.7, 4.4).

Root cause (brackit) + fix

Int32/Int64 matched a double/float operand by its concrete Dbl/Flt class instead of the DblNumeric/FltNumeric interface (decimals were already matched by interface). 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 at the root in brackit (sirixdb/brackit#96): Int32/Int64 now dispatch on the numeric interfaces, exactly as the base Int already does. This PR bumps the brackit dependency to 1.0-alpha2-SNAPSHOT.

Tests

NumericComparisonRegressionTest guards order by / min / max / comparison / arithmetic over mixed Int64 and xs:double document-sourced numbers (each case threw XPTY0004 before the brackit fix).

…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.
@JohannesLichtenberger JohannesLichtenberger merged commit 2ca4d04 into main Jun 6, 2026
16 of 17 checks passed
@JohannesLichtenberger JohannesLichtenberger deleted the fix/numeric-dbitem-comparison branch June 6, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant