-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-46009][SQL][FOLLOWUP] Remove unused PERCENTILE_CONT and PERCEN…
…TILE_DISC in g4 ### What changes were proposed in this pull request? This PR propose to remove unused `PERCENTILE_CONT` and `PERCENTILE_DISC` in g4 ### Why are the changes needed? #43910 merged the parse rule of `PercentileCont` and `PercentileDisc` into `functionCall`, but forgot to remove unused `PERCENTILE_CONT` and `PERCENTILE_DISC` in g4. ### Does this PR introduce _any_ user-facing change? 'No'. ### How was this patch tested? GA. ### Was this patch authored or co-authored using generative AI tooling? 'No'. Closes #46272 from beliefer/SPARK-46009_followup2. Authored-by: beliefer <beliefer@163.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
- Loading branch information
1 parent
26c871f
commit ad63eef
Showing
7 changed files
with
127 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
sql/core/src/test/resources/sql-tests/analyzer-results/window2.sql.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
-- Automatically generated by SQLQueryTestSuite | ||
-- !query | ||
CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES | ||
(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), | ||
(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), | ||
(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), | ||
(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), | ||
(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), | ||
(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), | ||
(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), | ||
(null, null, null, null, null, null), | ||
(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) | ||
AS testData(val, val_long, val_double, val_date, val_timestamp, cate) | ||
-- !query analysis | ||
CreateViewCommand `testData`, SELECT * FROM VALUES | ||
(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), | ||
(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), | ||
(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), | ||
(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), | ||
(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), | ||
(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), | ||
(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), | ||
(null, null, null, null, null, null), | ||
(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) | ||
AS testData(val, val_long, val_double, val_date, val_timestamp, cate), false, true, LocalTempView, true | ||
+- Project [val#x, val_long#xL, val_double#x, val_date#x, val_timestamp#x, cate#x] | ||
+- SubqueryAlias testData | ||
+- LocalRelation [val#x, val_long#xL, val_double#x, val_date#x, val_timestamp#x, cate#x] | ||
|
||
|
||
-- !query | ||
CREATE OR REPLACE TEMPORARY VIEW basic_pays AS SELECT * FROM VALUES | ||
('Diane Murphy','Accounting',8435), | ||
('Mary Patterson','Accounting',9998), | ||
('Jeff Firrelli','Accounting',8992), | ||
('William Patterson','Accounting',8870), | ||
('Gerard Bondur','Accounting',11472), | ||
('Anthony Bow','Accounting',6627), | ||
('Leslie Jennings','IT',8113), | ||
('Leslie Thompson','IT',5186), | ||
('Julie Firrelli','Sales',9181), | ||
('Steve Patterson','Sales',9441), | ||
('Foon Yue Tseng','Sales',6660), | ||
('George Vanauf','Sales',10563), | ||
('Loui Bondur','SCM',10449), | ||
('Gerard Hernandez','SCM',6949), | ||
('Pamela Castillo','SCM',11303), | ||
('Larry Bott','SCM',11798), | ||
('Barry Jones','SCM',10586) | ||
AS basic_pays(employee_name, department, salary) | ||
-- !query analysis | ||
CreateViewCommand `basic_pays`, SELECT * FROM VALUES | ||
('Diane Murphy','Accounting',8435), | ||
('Mary Patterson','Accounting',9998), | ||
('Jeff Firrelli','Accounting',8992), | ||
('William Patterson','Accounting',8870), | ||
('Gerard Bondur','Accounting',11472), | ||
('Anthony Bow','Accounting',6627), | ||
('Leslie Jennings','IT',8113), | ||
('Leslie Thompson','IT',5186), | ||
('Julie Firrelli','Sales',9181), | ||
('Steve Patterson','Sales',9441), | ||
('Foon Yue Tseng','Sales',6660), | ||
('George Vanauf','Sales',10563), | ||
('Loui Bondur','SCM',10449), | ||
('Gerard Hernandez','SCM',6949), | ||
('Pamela Castillo','SCM',11303), | ||
('Larry Bott','SCM',11798), | ||
('Barry Jones','SCM',10586) | ||
AS basic_pays(employee_name, department, salary), false, true, LocalTempView, true | ||
+- Project [employee_name#x, department#x, salary#x] | ||
+- SubqueryAlias basic_pays | ||
+- LocalRelation [employee_name#x, department#x, salary#x] | ||
|
||
|
||
-- !query | ||
CREATE OR REPLACE TEMPORARY VIEW test_ignore_null AS SELECT * FROM VALUES | ||
('a', 0, null), | ||
('a', 1, 'x'), | ||
('b', 2, null), | ||
('c', 3, null), | ||
('a', 4, 'y'), | ||
('b', 5, null), | ||
('a', 6, 'z'), | ||
('a', 7, 'v'), | ||
('a', 8, null) | ||
AS test_ignore_null(content, id, v) | ||
-- !query analysis | ||
CreateViewCommand `test_ignore_null`, SELECT * FROM VALUES | ||
('a', 0, null), | ||
('a', 1, 'x'), | ||
('b', 2, null), | ||
('c', 3, null), | ||
('a', 4, 'y'), | ||
('b', 5, null), | ||
('a', 6, 'z'), | ||
('a', 7, 'v'), | ||
('a', 8, null) | ||
AS test_ignore_null(content, id, v), false, true, LocalTempView, true | ||
+- Project [content#x, id#x, v#x] | ||
+- SubqueryAlias test_ignore_null | ||
+- LocalRelation [content#x, id#x, v#x] | ||
|
||
|
||
-- !query | ||
SELECT val_date, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_date | ||
RANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING) FROM testData | ||
ORDER BY cate, val_date | ||
-- !query analysis | ||
org.apache.spark.sql.catalyst.ExtendedAnalysisException | ||
{ | ||
"errorClass" : "DATATYPE_MISMATCH.RANGE_FRAME_INVALID_TYPE", | ||
"sqlState" : "42K09", | ||
"messageParameters" : { | ||
"orderSpecType" : "\"DATE\"", | ||
"sqlExpr" : "\"(PARTITION BY cate ORDER BY val_date ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND INTERVAL '1 02:03:04.001' DAY TO SECOND FOLLOWING)\"", | ||
"valueBoundaryType" : "\"INTERVAL DAY TO SECOND\"" | ||
}, | ||
"queryContext" : [ { | ||
"objectType" : "", | ||
"objectName" : "", | ||
"startIndex" : 47, | ||
"stopIndex" : 160, | ||
"fragment" : "(PARTITION BY cate ORDER BY val_date\nRANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING)" | ||
} ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters