[ 
https://issues.apache.org/jira/browse/CALCITE-5118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540721#comment-17540721
 ] 

Julian Hyde edited comment on CALCITE-5118 at 5/23/22 6:20 PM:
---------------------------------------------------------------

Thanks [~julianhyde] 's suggestion, I've created CALCITE-5167 to do the 
"deprecating rewriteCall mechanism" work. If it's still complicated, I may try 
to make it an umbrella issue and split it into more subtasks (I will make the 
decision when I started to work on this).

For this ticket, I think we can go on the code reviewing. Thank you all~


was (Author: libenchao):
Thanks [~julianhyde] 's suggestion, I've created 
https://issues.apache.org/jira/browse/CALCITE-5167 to do the "deprecating 
rewriteCall mechanism" work. If it's still complicated, I may try to make it an 
umbrella issue and split it into more subtasks (I will make the decision when I 
started to work on this).

For this ticket, I think we can go on the code reviewing. Thank you all~

> SqlDatePartFunction#rewriteCall should check operands length
> ------------------------------------------------------------
>
>                 Key: CALCITE-5118
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5118
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.30.0
>            Reporter: Benchao Li
>            Assignee: Benchao Li
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.31.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> {{SqlDatePartFunction#rewriteCall}} does not check operands length for now, 
> and it will be rewrite to {{EXTRACT}} unconditionally before validation.
> E.g.
> {code:sql}
> select week(); -- will throw ArrayIndexOutOfBoundsException
> select week(date '2022-04-27', 1); -- will just ignore second param
> {code}
> However, these cases should throw validation exceptions, because {{week}} 
> actually only accept 1 operand.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to