[CALCITE-6015] AssertionError during optimization of EXTRACT expression
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.
This PR implements several instances of the EXTRACT function which weren't supported. I would appreciate a review.
Can anyone please review this PR?
Thanks @mihaibudiu , no further comment from my side. LGTM.
Squashed the commits in preparation for merging.
Thanks @mihaibudiu ! @snuyanzin do you have any further remark? Otherwise IMO this PR is in a good shape to be merged.
Quality Gate passed
Issues
10 New issues
0 Accepted issues
Measures
0 Security Hotspots
98.4% Coverage on New Code
0.0% Duplication on New Code







