You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-29623][SQL] do not allow multiple unit TO unit statements in interval literal syntax
### What changes were proposed in this pull request?
re-arrange the parser rules to make it clear that multiple unit TO unit statement like `SELECT INTERVAL '1-1' YEAR TO MONTH '2-2' YEAR TO MONTH` is not allowed.
### Why are the changes needed?
This is definitely an accident that we support such a weird syntax in the past. It's not supported by any other DBs and I can't think of any use case of it. Also no test covers this syntax in the current codebase.
### Does this PR introduce any user-facing change?
Yes, and a migration guide item is added.
### How was this patch tested?
new tests.
Closesapache#26285 from cloud-fan/syntax.
Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Copy file name to clipboardExpand all lines: docs/sql-migration-guide.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ license: |
9
9
The ASF licenses this file to You under the Apache License, Version 2.0
10
10
(the "License"); you may not use this file except in compliance with
11
11
the License. You may obtain a copy of the License at
12
-
12
+
13
13
http://www.apache.org/licenses/LICENSE-2.0
14
-
14
+
15
15
Unless required by applicable law or agreed to in writing, software
16
16
distributed under the License is distributed on an "AS IS" BASIS,
17
17
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -218,6 +218,8 @@ license: |
218
218
219
219
- Since Spark 3.0, the `size` function returns `NULL` for the `NULL` input. In Spark version 2.4 and earlier, this function gives `-1` for the same input. To restore the behavior before Spark 3.0, you can set `spark.sql.legacy.sizeOfNull` to `true`.
220
220
221
+
- Since Spark 3.0, the interval literal syntax does not allow multiple from-to units anymore. For example, `SELECT INTERVAL '1-1' YEAR TO MONTH '2-2' YEAR TO MONTH'` throws parser exception.
222
+
221
223
## Upgrading from Spark SQL 2.4 to 2.4.1
222
224
223
225
- The value of `spark.executor.heartbeatInterval`, when specified without units like "30" rather than "30s", was
0 commit comments