MaxGekk opened a new pull request #32134:
URL: https://github.com/apache/spark/pull/32134
### What changes were proposed in this pull request?
1. Extend SQL syntax rules to support sign before ANSI interval strings of
year-month and day-time intervals.
2. Recognize `-` in AstBuilder and negate parsed intervals.
### Why are the changes needed?
To conform the SQL standard which allows sign before the string intervals,
see "5.3 <literal>":
```
<interval literal> ::=
INTERVAL [ <sign> ] <interval string> <interval qualifier>
<interval string> ::=
<quote> <unquoted interval string> <quote>
<unquoted interval string> ::=
[ <sign> ] { <year-month literal> | <day-time literal> }
<sign> ::=
<plus sign>
| <minus sign>
```
### Does this PR introduce _any_ user-facing change?
Should not because it just extends supported intervals syntax.
### How was this patch tested?
By running new tests in `interval.sql`:
```
$ build/sbt "sql/testOnly *SQLQueryTestSuite -- -z interval.sql"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]