calcite icon indicating copy to clipboard operation
calcite copied to clipboard

[CALCITE-6015] AssertionError during optimization of EXTRACT expression

Open mihaibudiu opened this issue 2 years ago • 7 comments

While attempting to fix the bug described in the issue I have discovered that many cases for EXTRACT are actually not implemented. So I implemented most of them, and I have improved the validation as well; the case indicated in the JIRA issue will now be rejected statically.

There is one case for EXTRACT which I haven't implemented: EXTRACT(EPOCH FROM INTERVAL '...' YEAR TO MONTH) because I wasn't sure how to properly use the convertlets to do it. Help would be appreciated.

This PR also makes some unexpected tiny changes in SqlValidatorImpl and SqlCall, so I would appreciate comments from people who are more knowledgeable.

mihaibudiu avatar Sep 21 '23 04:09 mihaibudiu

This PR implements several instances of the EXTRACT function which weren't supported. I would appreciate a review.

mihaibudiu avatar Jan 31 '24 23:01 mihaibudiu

Can anyone please review this PR?

mihaibudiu avatar Feb 27 '24 01:02 mihaibudiu

Thanks @mihaibudiu , no further comment from my side. LGTM.

rubenada avatar Mar 09 '24 19:03 rubenada

Squashed the commits in preparation for merging.

mihaibudiu avatar Mar 09 '24 19:03 mihaibudiu

Thanks @mihaibudiu ! @snuyanzin do you have any further remark? Otherwise IMO this PR is in a good shape to be merged.

rubenada avatar Mar 21 '24 07:03 rubenada