Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for analyzer #48675

Merged
merged 6 commits into from
Apr 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
143 changes: 0 additions & 143 deletions tests/queries/0_stateless/02496_remove_redundant_sorting.reference
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
-- Disabled query_plan_remove_redundant_sorting
-- ORDER BY clauses in subqueries are untouched
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + Projection))
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + Projection))
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression (Before ORDER BY)
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- Enabled query_plan_remove_redundant_sorting
-- ORDER BY removes ORDER BY clauses in subqueries
-- query
Expand All @@ -34,13 +26,9 @@ FROM
ORDER BY number ASC
-- explain
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + (Before ORDER BY + (Projection + Before ORDER BY)))))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand All @@ -62,19 +50,12 @@ FROM
ORDER BY number ASC
-- explain
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + Projection))
Header: number UInt64
Filling
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand All @@ -97,21 +78,13 @@ FROM
ORDER BY number ASC
-- explain
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + Projection))
Header: number UInt64
LimitBy
Header: number UInt64
Expression (Before LIMIT BY)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand Down Expand Up @@ -142,27 +115,15 @@ FROM
) AS t2
-- explain
Expression ((Projection + Before ORDER BY))
Header: number UInt64
t2.number UInt64
Join (JOIN FillRightFirst)
Header: number UInt64
t2.number UInt64
Expression ((Before JOIN + Projection))
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
Expression ((Joined actions + (Rename joined columns + Projection)))
Header: t2.number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0 2
0 1
Expand Down Expand Up @@ -200,25 +161,13 @@ FROM
ORDER BY t1.number, t2.number
-- explain
Expression (Projection)
Header: number UInt64
t2.number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
t2.number UInt64
Expression (Before ORDER BY)
Header: number UInt64
t2.number UInt64
Join (JOIN FillRightFirst)
Header: number UInt64
t2.number UInt64
Expression ((Before JOIN + (Projection + (Before ORDER BY + (Projection + Before ORDER BY)))))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
Expression ((Joined actions + (Rename joined columns + (Projection + (Before ORDER BY + (Projection + Before ORDER BY))))))
Header: t2.number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0 0
0 1
Expand Down Expand Up @@ -246,14 +195,9 @@ FROM
GROUP BY number
-- explain
Expression ((Projection + Before ORDER BY))
Header: sum(number) UInt64
Aggregating
Header: number UInt64
sum(number) UInt64
Expression ((Before GROUP BY + (Projection + (Before ORDER BY + (Projection + Before ORDER BY)))))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
2
Expand All @@ -275,13 +219,9 @@ FROM
GROUP BY number
-- explain
Expression ((Projection + Before ORDER BY))
Header: number UInt64
Aggregating
Header: number UInt64
Expression ((Before GROUP BY + (Projection + (Before ORDER BY + (Projection + Before ORDER BY)))))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
2
Expand All @@ -297,13 +237,9 @@ FROM
)
-- explain
Expression ((Projection + Before ORDER BY))
Header: sum(number) UInt64
Aggregating
Header: sum(number) UInt64
Expression ((Before GROUP BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
45
-- check that optimization is applied recursively to subqueries as well
Expand All @@ -324,18 +260,11 @@ FROM
ORDER BY a ASC
-- explain
Expression (Projection)
Header: a UInt64
Sorting (Sorting for ORDER BY)
Header: a UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: a UInt64
Aggregating
Header: number UInt64
sum(number) UInt64
Expression ((Before GROUP BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand All @@ -357,17 +286,11 @@ FROM
ORDER BY a ASC
-- explain
Expression (Projection)
Header: a UInt64
Sorting (Sorting for ORDER BY)
Header: a UInt64
Expression ((Before ORDER BY + (Projection + Before ORDER BY)))
Header: a UInt64
Aggregating
Header: number UInt64
Expression ((Before GROUP BY + (Projection + Before ORDER BY)))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand All @@ -394,15 +317,10 @@ FROM
WHERE a > 0
-- explain
Expression ((Projection + (Before ORDER BY + )))
Header: a UInt64
Aggregating
Header: number UInt64
Filter
Header: number UInt64
Filter (( + (Before GROUP BY + (Projection + (Before ORDER BY + (Projection + Before ORDER BY))))))
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
2
1
Expand All @@ -424,17 +342,11 @@ FROM
ORDER BY number ASC
-- explain
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression ((Before ORDER BY + (Projection + (Before ORDER BY + (Projection + Before ORDER BY)))))
Header: number UInt64
Aggregating
Header: number UInt64
Expression (Before GROUP BY)
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0
1
Expand All @@ -459,28 +371,16 @@ FROM
)
-- explain
Expression ((Projection + Before ORDER BY))
Header: toTypeName(sum(v)) String
sum(v) Float64
Aggregating
Header: sum(v) Float64
Expression ((Before GROUP BY + Projection))
Header: v Float64
Sorting (Sorting for ORDER BY)
Header: v Float64
Union
Header: v Float64
Expression ((Before ORDER BY + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
-- execute
Float64 9007199254740994
-- sum() with Nullable(Floats) depends on order, -> sorting is not removed here
Expand All @@ -503,28 +403,16 @@ FROM
)
-- explain
Expression ((Projection + Before ORDER BY))
Header: toTypeName(sum(v)) String
sum(v) Nullable(Float64)
Aggregating
Header: sum(v) Nullable(Float64)
Expression ((Before GROUP BY + Projection))
Header: v Nullable(Float64)
Sorting (Sorting for ORDER BY)
Header: v Nullable(Float64)
Union
Header: v Nullable(Float64)
Expression ((Before ORDER BY + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Nullable(Float64)
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Nullable(Float64)
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Nullable(Float64)
ReadFromStorage (SystemOne)
Header: dummy UInt8
-- execute
Nullable(Float64) 9007199254740994
-- sumIf() with Floats depends on order, -> sorting is not removed here
Expand All @@ -547,29 +435,16 @@ FROM
)
-- explain
Expression ((Projection + Before ORDER BY))
Header: toTypeName(sumIf(v, greater(v, 0))) String
sumIf(v, greater(v, 0)) Float64
Aggregating
Header: sumIf(v, greater(v, 0)) Float64
Expression ((Before GROUP BY + Projection))
Header: v Float64
greater(v, 0) UInt8
Sorting (Sorting for ORDER BY)
Header: v Float64
Union
Header: v Float64
Expression ((Before ORDER BY + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
Expression (( + (Conversion before UNION + (Projection + Before ORDER BY))))
Header: v Float64
ReadFromStorage (SystemOne)
Header: dummy UInt8
-- execute
Float64 9007199254740994
-- disable common optimization to avoid functions to be lifted up (liftUpFunctions optimization), needed for testing with stateful function
Expand All @@ -587,22 +462,12 @@ FROM
ORDER BY number ASC
-- explain
Expression (Projection)
Header: number UInt64
neighbor(number, 2) UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
neighbor(number, 2) UInt64
Expression (Before ORDER BY)
Header: number UInt64
neighbor(number, 2) UInt64
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression (Before ORDER BY)
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
0 0
1 0
Expand All @@ -627,19 +492,11 @@ FROM
)
-- explain
Expression (Projection)
Header: number UInt64
plus(number, 2) UInt64
Expression (Before ORDER BY)
Header: number UInt64
plus(number, 2) UInt64
Expression (Projection)
Header: number UInt64
Sorting (Sorting for ORDER BY)
Header: number UInt64
Expression (Before ORDER BY)
Header: number UInt64
ReadFromStorage (SystemNumbers)
Header: number UInt64
-- execute
9 11
8 10
Expand Down