Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

olivrlee
Copy link
Contributor

@olivrlee olivrlee commented Mar 6, 2024

… 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 tjbanghart@gmail.com

… 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 <tjbanghart@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant