calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-5607] Datetime MINUS throws ArrayIndexOutOfBounds error when…

Open olivrlee opened this issue 1 year ago • 0 comments

… serializing toRex

Uncovered a bug in RelJson#toRex for the TIMESTAMP_DIFF call for Big Query dialect which is translated to Datetime MINUS. MINUS_DATE uses an ARG2_NULLABLE return type inference which requires 3 operands, however there are only 2 operands for BQ. The solution is to add in "type" when serializing to JSON in RelJson.toJson(RexNode node) [like we do for CAST] so that jsonType will be defined in toRex and it doesn't rely on the operands.

Co-authored-by: TJ Banghart [email protected]

olivrlee avatar Mar 06 '24 00:03 olivrlee