odc icon indicating copy to clipboard operation
odc copied to clipboard

[Bug]: fail to parse sql with `interval`

Open LuckyPickleZZ opened this issue 1 year ago • 1 comments

ODC version

4.2+

OB version

4.2+

What happened?

execute this sql, there would be exception reported in log file. You have an error in your SQL syntax; check the manual for the right syntax to use near '01' + interval '1'...' at line 17, col 82


SELECT s_name,
       s_address
FROM   supplier,
       nation
WHERE  s_suppkey IN (SELECT ps_suppkey
                     FROM   partsupp
                     WHERE  ps_partkey IN (SELECT p_partkey
                                           FROM   part
                                           WHERE  p_name LIKE 'green%')
                            AND ps_availqty > (SELECT 0.5 * SUM(l_quantity)
                                               FROM   lineitem
                                               WHERE  l_partkey = ps_partkey
                                                      AND l_suppkey = ps_suppkey
                                                      AND l_shipdate >= DATE
                                                          '1993-01-01'
                                                      AND l_shipdate < DATE
                                                          '1993-01-01' + interval '1' year
                                              ))
       AND s_nationkey = n_nationkey
       AND n_name = 'ALGERIA'
ORDER  BY s_name;

What did you expect to happen?

How can we reproduce it (as minimally and precisely as possible)?

Anything else we need to know?

No response

LuckyPickleZZ avatar Jul 02 '24 11:07 LuckyPickleZZ

this issue may be fixed at 4.3.2

yhilmare avatar Jul 02 '24 11:07 yhilmare

Image pass

sl01388797 avatar Sep 19 '24 07:09 sl01388797