Matthew Bayer created CALCITE-7681:
--------------------------------------

             Summary: SqlDatetimeSubtractionOperator drops parentheses around 
compound interval expressions
                 Key: CALCITE-7681
                 URL: https://issues.apache.org/jira/browse/CALCITE-7681
             Project: Calcite
          Issue Type: Bug
            Reporter: Matthew Bayer


[{{SqlDialect.unparseSqlDatetimeArithmetic}}|https://github.com/apache/calcite/blob/701da98408d95ecdc8e80af9be2dc805e6c23242/core/src/main/java/org/apache/calcite/sql/SqlDialect.java#L496-L508]
 does not apply the datetime operator’s precedence when unparsing its right 
operand.

{{-- Input
CURRENT_DATE - (INTERVAL '3' YEAR + INTERVAL '3' YEAR)}}

{{}}

{{-- Incorrect RelToSql output
CURRENT_DATE - INTERVAL '3' YEAR + INTERVAL '3' YEAR}}

{{}}

{{}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to