-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into xx/bump-foyer-storage
- Loading branch information
Showing
168 changed files
with
4,837 additions
and
987 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
statement ok | ||
create table t (id int, pat varchar, text varchar); | ||
|
||
# example data from https://www.postgresql.org/docs/16/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP | ||
statement ok | ||
insert into | ||
t | ||
values | ||
(1, 'abc', 'abc'), | ||
(2, 'a', 'abc'), | ||
(3, '%(b|d)%', 'abc'), | ||
(4, '(b|c)%', 'abc'), | ||
(5, '%abc-%', '-abc-'), | ||
(6, '%abc-%', 'xabcy'); | ||
|
||
query B | ||
select (text similar to pat) from t order by id; | ||
---- | ||
t | ||
f | ||
t | ||
f | ||
t | ||
f | ||
|
||
query B | ||
select (text not similar to pat) from t order by id; | ||
---- | ||
f | ||
t | ||
f | ||
t | ||
f | ||
t | ||
|
||
query T | ||
select text from t where text similar to pat order by id; | ||
---- | ||
abc | ||
abc | ||
-abc- | ||
|
||
query T | ||
select text from t where text not similar to pat order by id; | ||
---- | ||
abc | ||
abc | ||
xabcy | ||
|
||
query I | ||
select count(1) from t where text similar to 'ab%'; | ||
---- | ||
4 | ||
|
||
query I | ||
select count(1) from t where text not similar to 'ab%'; | ||
---- | ||
2 | ||
|
||
query B | ||
select 'foobar' similar to '%#"o_b#"%'; | ||
---- | ||
f | ||
|
||
# default escape string | ||
query B | ||
select 'foobar' similar to '%#"o_b#"%' escape '\'; | ||
---- | ||
f | ||
|
||
# fallback to default escape string | ||
query B | ||
select 'foobar' similar to '%#"o_b#"%' escape ''; | ||
---- | ||
f | ||
|
||
query B | ||
select 'foobar' similar to '%#"o_b#"%' escape '#'; | ||
---- | ||
t | ||
|
||
query B | ||
select 'foobar' not similar to '%#"o_b#"%' escape '#'; | ||
---- | ||
f | ||
|
||
query B | ||
select 'foobar' similar to '%🤡"o_b🤡"%' escape '🤡'; | ||
---- | ||
t | ||
|
||
query B | ||
select 'foobar' not similar to '%👪"o_b👪"%' escape '👪'; | ||
---- | ||
f | ||
|
||
statement ok | ||
drop table t; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
statement ok | ||
set RW_IMPLICIT_FLUSH to true; | ||
|
||
statement ok | ||
create table t (x int); | ||
|
||
query II | ||
select (select x from t) x, 1 one; | ||
---- | ||
NULL 1 | ||
|
||
statement ok | ||
insert into t values (114514); | ||
|
||
query II | ||
select (select x from t) x, 1 one; | ||
---- | ||
114514 1 | ||
|
||
# Cannot create materialized view as the cardinality of the subquery is unknown | ||
statement error Scalar subquery might produce more than one row | ||
create materialized view mv as select (select x from t) x, 1 one; | ||
|
||
statement ok | ||
insert into t values (1919810); | ||
|
||
# Cannot query as the cardinality of the subquery is now 2 | ||
query error Scalar subquery produced more than one row | ||
select (select x from t) x, 1 one; | ||
|
||
statement ok | ||
drop table t; |
31 changes: 31 additions & 0 deletions
31
e2e_test/over_window/generated/batch/odd_frames/mod.slt.part
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,31 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test weird window frames. | ||
|
||
statement ok | ||
create table t (a int, b int, c int); | ||
|
||
statement ok | ||
create view v as | ||
select | ||
count(*) over (partition by 1::int order by b rows between 1 preceding and 10 preceding), | ||
count(*) over (partition by 1::int order by b rows between 10 following and 1 following) | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(1, 1, 1) | ||
,(1, 2, 3) | ||
,(1, 4, 9) | ||
; | ||
|
||
query II | ||
select * from v; | ||
---- | ||
0 0 | ||
|
||
statement ok | ||
drop view v; | ||
|
||
statement ok | ||
drop table t; |
31 changes: 31 additions & 0 deletions
31
e2e_test/over_window/generated/streaming/odd_frames/mod.slt.part
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,31 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test weird window frames. | ||
|
||
statement ok | ||
create table t (a int, b int, c int); | ||
|
||
statement ok | ||
create materialized view v as | ||
select | ||
count(*) over (partition by 1::int order by b rows between 1 preceding and 10 preceding), | ||
count(*) over (partition by 1::int order by b rows between 10 following and 1 following) | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(1, 1, 1) | ||
,(1, 2, 3) | ||
,(1, 4, 9) | ||
; | ||
|
||
query II | ||
select * from v; | ||
---- | ||
0 0 | ||
|
||
statement ok | ||
drop materialized view v; | ||
|
||
statement ok | ||
drop table t; |
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,29 @@ | ||
# Test weird window frames. | ||
|
||
statement ok | ||
create table t (a int, b int, c int); | ||
|
||
statement ok | ||
create $view_type v as | ||
select | ||
count(*) over (partition by 1::int order by b rows between 1 preceding and 10 preceding), | ||
count(*) over (partition by 1::int order by b rows between 10 following and 1 following) | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(1, 1, 1) | ||
,(1, 2, 3) | ||
,(1, 4, 9) | ||
; | ||
|
||
query II | ||
select * from v; | ||
---- | ||
0 0 | ||
|
||
statement ok | ||
drop $view_type v; | ||
|
||
statement ok | ||
drop table t; |
Oops, something went wrong.