You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
When converting a set of literals to Sarg, calcite will throw exception if there is both type of integer and double, although they are both numeric family
Exception stack:
class java.lang.Double cannot be cast to class java.math.BigDecimal (java.lang.Double and java.math.BigDecimal are in module java.base of loader 'bootstrap')
java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.math.BigDecimal (java.lang.Double and java.math.BigDecimal are in module java.base of loader 'bootstrap')
at java.base/java.math.BigDecimal.compareTo(BigDecimal.java:305)
at com.google.common.collect.Range.compareOrThrow(Range.java:702)
at com.google.common.collect.Cut.compareTo(Cut.java:80)
at com.google.common.collect.Range.<init>(Range.java:331)
at com.google.common.collect.Range.create(Range.java:132)
at com.google.common.collect.Range.closed(Range.java:157)
at org.apache.calcite.rex.RexBuilder.makeBetween(RexBuilder.java:1805)
at org.apache.calcite.tools.RelBuilder.between(RelBuilder.java:1153)
at org.apache.calcite.tools.RelBuilder.call(RelBuilder.java:752)
at org.apache.calcite.tools.RelBuilder.call(RelBuilder.java:765)
at org.apache.calcite.tools.RelBuilder.call(RelBuilder.java:736)
The text was updated successfully, but these errors were encountered:
It should work to perform cast from our side as a workaround. But I believe it should be a bug from Calcite. For RexBuilder::makeIn, since RexBuilder::areAssignable returns true, it should be able to transform into a Sarg. Otherwise it should return false and choose to invoke composeDisjunction(which should works as well) instead of throw exception; For RexBuilder::makeBetween, it should choose to build And(a > low, a < upper).
What is the bug?
When converting a set of literals to
Sarg
, calcite will throw exception if there is both type of integer and double, although they are bothnumeric
familyException stack:
The text was updated successfully, but these errors were encountered: