Skip to content

Commit 0aeb1d8

Browse files
committed
slt rewrites -- much weirdness
1 parent 7d46ec0 commit 0aeb1d8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

test/sqllogictest/freshmart.slt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Explained Query:
291291
Get l6
292292
Return
293293
Project (#0, #13, #11)
294-
Map (case when (#8) IS NULL then null else #7 end, (((((#2 * case when (#3 <= 3) then 1.2 else case when ((#3 <= 10) AND (#3 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#5 / 100)), 1)) * case when (#12 <= 3) then 1.1 else case when ((#12 <= 10) AND (#12 >= 4)) then 1.05 else 1 end end) * case when (#2 > #4) then (1 + ((#2 - #4) / #4)) else (1 - ((#4 - #2) / #4)) end) * case when ilike["%cheap%"](varchar_to_text(#1)) then 0.8 else 1 end))
294+
Map (case when (#8) IS NULL then null else #7 end, (((((#2 * case when (#3 <= 3) then 1.2 else case when ((#3 <= 10) AND (#3 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#5 / 100)), 1)) * case when (#12 <= 3) then 1.1 else case when ((#12 <= 10) AND (#12 >= 4)) then 1.05 else 1 end end) * case when (#2 > #4) then (1 + ((#2 - #4) / #4)) else (1 - ((#4 - #2) / #4)) end) * case when ilike["%cheap%"](#1) then 0.8 else 1 end))
295295
Join on=(#0 = #6 = #9 = #10) type=delta
296296
ArrangeBy keys=[[#0]]
297297
Get l6
@@ -639,7 +639,7 @@ Explained Query:
639639
Get l7
640640
cte l11 =
641641
Project (#0, #1, #3, #5, #18)
642-
Map (case when (#14) IS NULL then null else #13 end, (((((#8 * case when (#9 <= 3) then 1.2 else case when ((#9 <= 10) AND (#9 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#11 / 100)), 1)) * case when (#17 <= 3) then 1.1 else case when ((#17 <= 10) AND (#17 >= 4)) then 1.05 else 1 end end) * case when (#8 > #10) then (1 + ((#8 - #10) / #10)) else (1 - ((#10 - #8) / #10)) end) * case when ilike["%cheap%"](varchar_to_text(#7)) then 0.8 else 1 end))
642+
Map (case when (#14) IS NULL then null else #13 end, (((((#8 * case when (#9 <= 3) then 1.2 else case when ((#9 <= 10) AND (#9 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#11 / 100)), 1)) * case when (#17 <= 3) then 1.1 else case when ((#17 <= 10) AND (#17 >= 4)) then 1.05 else 1 end end) * case when (#8 > #10) then (1 + ((#8 - #10) / #10)) else (1 - ((#10 - #8) / #10)) end) * case when ilike["%cheap%"](#7) then 0.8 else 1 end))
643643
Join on=(#0 = #2 = #6 = #12 = #15 = #16 AND #3 = #4) type=delta
644644
ArrangeBy keys=[[#0]]
645645
Project (#0, #1)
@@ -895,7 +895,7 @@ Explained Query:
895895
Get l7
896896
cte l11 =
897897
Project (#0, #1, #3, #5, #18)
898-
Map (case when (#14) IS NULL then null else #13 end, (((((#8 * case when (#9 <= 3) then 1.2 else case when ((#9 <= 10) AND (#9 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#11 / 100)), 1)) * case when (#17 <= 3) then 1.1 else case when ((#17 <= 10) AND (#17 >= 4)) then 1.05 else 1 end end) * case when (#8 > #10) then (1 + ((#8 - #10) / #10)) else (1 - ((#10 - #8) / #10)) end) * case when ilike["%cheap%"](varchar_to_text(#7)) then 0.8 else 1 end))
898+
Map (case when (#14) IS NULL then null else #13 end, (((((#8 * case when (#9 <= 3) then 1.2 else case when ((#9 <= 10) AND (#9 >= 4)) then 1.1 else 0.9 end end) * coalesce((1 - (#11 / 100)), 1)) * case when (#17 <= 3) then 1.1 else case when ((#17 <= 10) AND (#17 >= 4)) then 1.05 else 1 end end) * case when (#8 > #10) then (1 + ((#8 - #10) / #10)) else (1 - ((#10 - #8) / #10)) end) * case when ilike["%cheap%"](#7) then 0.8 else 1 end))
899899
Join on=(#0 = #2 = #6 = #12 = #15 = #16 AND #3 = #4) type=delta
900900
ArrangeBy keys=[[#0]]
901901
Project (#0, #1)

test/sqllogictest/github-5536.slt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ Explained Query:
4444
Filter (#0 <= #0) AND (#0 >= #0)
4545
ReadStorage materialize.public.t5
4646
ArrangeBy keys=[[]]
47-
Filter (#1 = text_to_char(text_to_varchar(boolean_to_text(like["0.31161855206970124"](padchar(#1))))))
47+
Filter (text_to_varchar(boolean_to_text(like["0.31161855206970124"](padchar(#1)))) = char_to_text(#1))
4848
ReadStorage materialize.public.t3
4949
ArrangeBy keys=[[]]
5050
ReadStorage materialize.public.t5
5151

5252
Source materialize.public.t0
5353
Source materialize.public.t3
54-
filter=((#1 = text_to_char(text_to_varchar(boolean_to_text(like["0.31161855206970124"](padchar(#1)))))))
54+
filter=((text_to_varchar(boolean_to_text(like["0.31161855206970124"](padchar(#1)))) = char_to_text(#1)))
5555
Source materialize.public.t5
5656

5757
Target cluster: quickstart

test/sqllogictest/type-promotion.slt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ query T multiline
317317
EXPLAIN RAW PLAN FOR
318318
SELECT 'a'::"char" < 'a'::varchar;
319319
----
320-
Map (("char"_to_text(text_to_"char"("a")) < varchar_to_text(text_to_varchar("a"))))
320+
Map (("char"_to_text(text_to_"char"("a")) < text_to_varchar("a")))
321321
Constant
322322
- ()
323323

@@ -343,7 +343,7 @@ query T multiline
343343
EXPLAIN RAW PLAN FOR
344344
SELECT 'a'::char < 'a'::varchar;
345345
----
346-
Map ((text_to_char(text_to_char("a")) < text_to_char(text_to_varchar("a"))))
346+
Map ((char_to_text(text_to_char(text_to_char("a"))) < text_to_varchar("a")))
347347
Constant
348348
- ()
349349

@@ -369,7 +369,7 @@ query T multiline
369369
EXPLAIN RAW PLAN FOR
370370
SELECT 'a'::varchar < 'a'::text;
371371
----
372-
Map ((varchar_to_text(text_to_varchar("a")) < "a"))
372+
Map ((text_to_varchar("a") < "a"))
373373
Constant
374374
- ()
375375

0 commit comments

Comments
 (0)