elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.53k stars 24.61k forks source link

[ESQL] Support binary comparisons between Unsigned Long and other numeric types #110663

Open not-napoleon opened 2 months ago

not-napoleon commented 2 months ago

Currently, binary comparisons between unsigned longs and other numeric types are unsupported. Supporting comparisons however does not require resolving any of the tricky casting questions that arithmetic needs to figure out. We know that all negative numbers are strictly less than all unsigned longs, so we can just return appropriately. For non-negative values, ints and longs can safely be cast to unsigned longs, and unsigned longs can be cast to double (which is lossy, but is what longs do)

elasticsearchmachine commented 2 months ago

Pinging @elastic/es-analytical-engine (Team:Analytics)