Aleksandr Efimov created IMPALA-15700:
-----------------------------------------
Summary: Calcite planner: validate DATE interval units
Key: IMPALA-15700
URL: https://issues.apache.org/jira/browse/IMPALA-15700
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Aleksandr Efimov
Assignee: Aleksandr Efimov
Calcite validation accepts sub-day intervals on DATE, while the original
analyzer rejects them.
Given a table t(dt DATE, i INT):
{code:sql}
SELECT dt + INTERVAL i HOUR FROM t;
SELECT DATE '2026-01-01' + INTERVAL 0 HOUR FROM t;
{code}
Calcite parse/validation succeeds and these expressions reach logical
optimization. Original analysis rejects them with "intervals are not allowed in
date arithmetic expressions".
Calcite validation should allow only YEAR, MONTH, WEEK and DAY intervals on
DATE, including DATE_ADD/DATE_SUB and reversed addition. TIMESTAMP arithmetic
with smaller units should remain valid.
This report concerns Calcite validation; native conversion already rejects the
tested runtime cases.
Reproduced on master 234bd0001e33.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)