You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Benchao Li (Jira)" <ji...@apache.org> on 2022/04/27 13:43:00 UTC
[jira] [Created] (CALCITE-5118) SqlDatePartFunction#rewriteCall should check operands length
Benchao Li created CALCITE-5118:
-----------------------------------
Summary: 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
Fix For: 1.31.0
{{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}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)