Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into xx/bump-foyer-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCroxx committed Dec 22, 2023
2 parents 5d63fb8 + 188228c commit 3c280c8
Show file tree
Hide file tree
Showing 168 changed files with 4,837 additions and 987 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"command": "/bin/bash",
"args": [
"-c",
"risedev k ; cargo build --bin risingwave"
"${workspaceFolder}/risedev k ; cargo build --bin risingwave"
]
}
]
}
}
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,9 @@ dependencies = ["prepare"]
condition = { env_set = [
"ENABLE_BUILD_RW_CONNECTOR",
], files_modified = { input = [
"./java/connector-node/**/*.java",
"./java/connector-node/**/*",
], output = [
"./java/connector-node/assembly/target/*",
"./java/connector-node/assembly/target/**/*",
] } }
description = "Build RisingWave Connector from source"
script = '''
Expand Down
2 changes: 1 addition & 1 deletion docker/dashboards/risingwave-dev-dashboard.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion e2e_test/batch/aggregate/ordered_set_agg.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ from (values(1::float8),(3),(5),(7)) t(a);
query RR
select
percentile_cont(0.25) within group (order by a),
percentile_disc(0.5) within group (order by a)
percentile_disc(0.2 + 0.3) within group (order by a)
from (values(1::float8),(3),(5),(7)) t(a);
----
2.5 3

query RR
select
percentile_cont(NULL) within group (order by a),
percentile_cont(0.3 + NULL) within group (order by a)
from (values(1::float8),(3),(5),(7)) t(a);
----
NULL NULL
98 changes: 98 additions & 0 deletions e2e_test/batch/functions/similar_to_escape.slt.part
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;
88 changes: 88 additions & 0 deletions e2e_test/batch/functions/to_char.slt.part
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
statement ok
SET RW_IMPLICIT_FLUSH TO true;

query T
SELECT to_char(timestamp '2002-04-20 17:31:12.66', 'HH12:MI:SS')
----
Expand Down Expand Up @@ -66,3 +69,88 @@ select to_char(tsz, 'YYYY-MM-DD HH24:MI:SS TZH:TZM') from t order by tsz;

statement ok
drop table t;


query T
select to_char('-20459year -256 days -120hours 866seconds'::interval, 'YYYY IYYY YY IY MM DD PM pm HH HH12 HH24 MI SS');
----
-20459 -20460 -59 -60 00 -256 AM am -11 -11 -119 -45 -34

query T
select to_char('0year -256 days -120hours'::interval, 'YYYY IYYY YY IY MM DD PM pm HH HH12 HH24 MI SS');
----
0000 -001 00 -1 00 -256 AM am 012 012 -120 00 00

query T
select to_char('0year 0 days 0hours'::interval, 'YYYY IYYY YY IY MM DD PM pm HH12 HH24 MI SS');
----
0000 -001 00 -1 00 00 AM am 12 00 00 00

query T
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'YYYY IYYY YY IY MM DD PM pm HH12 HH24 MI SS MS US');
----
0001 0001 01 01 01 01 AM am 01 01 01 01 000 000000

query T
select to_char('-1year -1month -1day -1hours -1minute -1second'::interval, 'YYYY IYYY YY IY MM DD PM pm HH12 HH24 MI SS MS US');
----
-0001 -0002 -01 -02 -01 -1 AM am -01 -01 -01 -01 000 000000

query T
select to_char('23:22:57.124562'::interval, 'HH12 MI SS MS US');
----
11 22 57 124 124562

query T
select to_char('-23:22:57.124562'::interval, 'HH12 MI SS MS US');
----
-11 -22 -57 -124 -124562

query error
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'IY MM DD AM HH12 MM SS tzhtzm');
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
2: Invalid parameter pattern: invalid format specification for an interval value, HINT: Intervals are not tied to specific calendar dates.


query error
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'IY MM DD AM HH12 MI SS TZH:TZM');
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
2: Invalid parameter pattern: invalid format specification for an interval value, HINT: Intervals are not tied to specific calendar dates.


query error
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'IY MM DD AM HH12 MI SS TZH');
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
2: Invalid parameter pattern: invalid format specification for an interval value, HINT: Intervals are not tied to specific calendar dates.


query error
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'IY MM DD AM HH12 MI SS Month');
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
2: Invalid parameter pattern: invalid format specification for an interval value, HINT: Intervals are not tied to specific calendar dates.


query error
select to_char('1year 1month 1day 1hours 1minute 1second'::interval, 'IY MM DD AM HH12 MI SS Mon');
----
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
2: Invalid parameter pattern: invalid format specification for an interval value, HINT: Intervals are not tied to specific calendar dates.
32 changes: 32 additions & 0 deletions e2e_test/batch/subquery/scalar_subquery.slt.part
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 e2e_test/over_window/generated/batch/odd_frames/mod.slt.part
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 e2e_test/over_window/generated/streaming/odd_frames/mod.slt.part
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;
29 changes: 29 additions & 0 deletions e2e_test/over_window/templates/odd_frames/mod.slt.part
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;
Loading

0 comments on commit 3c280c8

Please sign in to comment.