Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bz/error-rw-common
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Nov 24, 2023
2 parents 971f77c + bf3975f commit a1eaf84
Show file tree
Hide file tree
Showing 305 changed files with 3,927 additions and 2,806 deletions.
25 changes: 15 additions & 10 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ set -e
cargo nextest run \
--config "target.'cfg(all())'.rustflags = ['--cfg=madsim']" \
--features fail/failpoints \
-p risingwave_simulation \
"$@"
"""
Expand All @@ -980,6 +981,7 @@ set -e
cargo nextest archive \
--config "target.'cfg(all())'.rustflags = ['--cfg=madsim']" \
--features fail/failpoints \
-p risingwave_simulation \
--archive-file simulation-it-test.tar.zst \
"$@"
Expand Down
9 changes: 4 additions & 5 deletions ci/scripts/e2e-source-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,16 @@ echo "--- mysql & postgres cdc validate test"
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.validate.mysql.slt'
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.validate.postgres.slt'

# cdc share stream test cases
export MYSQL_HOST=mysql MYSQL_TCP_PORT=3306 MYSQL_PWD=123456
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.share_stream.slt'

echo "--- mysql & postgres load and check"
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.load.slt'
# wait for cdc loading
sleep 10
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.check.slt'

# cdc share stream test cases
export MYSQL_HOST=mysql MYSQL_TCP_PORT=3306 MYSQL_PWD=123456
sqllogictest -p 4566 -d dev './e2e_test/source/cdc/cdc.share_stream.slt'


# kill cluster
cargo make kill
echo "cluster killed "
Expand Down
3 changes: 2 additions & 1 deletion ci/scripts/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ cluster_stop
echo "--- e2e, $mode, error ui"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info" \
cluster_start
sqllogictest -p 4566 -d dev './e2e_test/error_ui/**/*.slt'
sqllogictest -p 4566 -d dev './e2e_test/error_ui/simple/**/*.slt'
sqllogictest -p 4566 -d dev -e postgres-extended './e2e_test/error_ui/extended/**/*.slt'

echo "--- Kill cluster"
cluster_stop
Expand Down
5 changes: 5 additions & 0 deletions ci/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ steps:
- "cockroach-sink"
- "kafka-cdc-sink"
- "cassandra-and-scylladb-sink"
- "elasticsearch-sink"
format:
- "json"
- "protobuf"
Expand Down Expand Up @@ -164,3 +165,7 @@ steps:
testcase: "cassandra-and-scylladb-sink"
format: "protobuf"
skip: true
- with:
testcase: "elasticsearch-sink"
format: "protobuf"
skip: true
2 changes: 1 addition & 1 deletion ci/workflows/main-cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ steps:
run: rw-build-env
config: ci/docker-compose.yml
mount-buildkite-agent: true
timeout_in_minutes: 15
timeout_in_minutes: 20
retry: *auto-retry

- label: "docslt"
Expand Down
6 changes: 5 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN rustup self update \
&& rustup show \
&& rustup component add rustfmt


RUN cargo install flamegraph
# TODO: cargo-chef doesn't work well now, because we update Cargo.lock very often.
# We may consider sccache instead.

Expand Down Expand Up @@ -115,6 +115,9 @@ FROM base AS risingwave

LABEL org.opencontainers.image.source https://github.com/risingwavelabs/risingwave

RUN apt-get update && apt-get -y install linux-tools-generic \
&& ln -s "$(find /usr/lib/linux-tools/*/perf | head -1)" /usr/local/bin/perf

RUN apt-get -y install gdb \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

Expand All @@ -125,6 +128,7 @@ COPY --from=rust-builder /risingwave/bin/risingwave.dwp /risingwave/bin/risingwa
COPY --from=java-builder /risingwave/bin/connector-node /risingwave/bin/connector-node
COPY --from=dashboard-builder /risingwave/dashboard/out /risingwave/ui
COPY --from=rust-builder /risingwave/bin/jeprof /usr/local/bin/jeprof
COPY --from=rust-base /root/.cargo/bin/flamegraph /usr/local/bin/flamegraph

# Set default playground mode to docker-playground profile
ENV PLAYGROUND_PROFILE docker-playground
Expand Down
2 changes: 1 addition & 1 deletion docker/dashboards/risingwave-dev-dashboard.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docker/dashboards/risingwave-user-dashboard.json

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions e2e_test/batch/functions/encdec.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Text/Binary String Conversion Functions

# encode/decode
# escape
query T
SELECT encode('\xc3b1', 'escape');
----
\303\261

query T
SELECT decode('\303\261', 'escape');
----
\xc3b1

query T
SELECT encode('\xe78e8be58695e6adbbe4ba86e788b6e4bab2', 'escape');
----
\347\216\213\345\206\225\346\255\273\344\272\206\347\210\266\344\272\262

query T
SELECT decode('王冕死了父亲', 'escape');
----
\xe78e8be58695e6adbbe4ba86e788b6e4bab2

# base64
query T
SELECT encode('123\000\001', 'base64');
----
MTIzAAE=

query T
SELECT decode('MTIzAAE=', 'base64');
----
\x3132330001

# hex
query T
SELECT encode('joanna', 'hex');
----
6a6f616e6e61

query T
SELECT decode('6a6f616e6e61', 'hex');
----
\x6a6f616e6e61

# convert
# convert_from
query T
SELECT convert_from('\xc3b1', 'UTF8');
----
ñ

query T
SELECT convert_from('\xe78e8be58695e6adbbe4ba86e788b6e4bab2', 'UTF8');
----
王冕死了父亲

query T
SELECT convert_from('\x6a6f616e6e61', 'UTF8');
----
joanna

# UTF[-]8, case-insensitive
query T
SELECT convert_from('\x6a6f616e6e61', 'UTF-8');
----
joanna

query T
SELECT convert_from('\x6a6f616e6e61', 'utf8');
----
joanna

query T
SELECT convert_from('\x6a6f616e6e61', 'utf-8');
----
joanna

query T
SELECT convert_from('\x6a6f616e6e61', 'UtF8');
----
joanna

query T
SELECT convert_from('\x6a6f616e6e61', 'uTF-8');
----
joanna

# convert_to
query T
SELECT convert_to('some_text', 'UTF8');
----
\x736f6d655f74657874

query T
SELECT convert_to('柠檬', 'UTF8');
----
\xe69fa0e6aaac

query T
SELECT convert_to('🍋', 'UTF8');
----
\xf09f8d8b

query T
SELECT convert_from(convert_to('good', 'UTF8'), 'UTF8');
----
good

query T
SELECT convert_from(convert_to('wow🐮', 'UTF8'), 'UTF8');
----
wow🐮
3 changes: 2 additions & 1 deletion e2e_test/error_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ When you find the tests in this directory failing...
- First, ensure that the changes to the error messages are expected and make them look better.
- Then, update the test cases by running:
```bash
./risedev slt './e2e_test/error_ui/**/*.slt' --override
./risedev slt './e2e_test/error_ui/simple/**/*.slt' --override
./risedev slt './e2e_test/error_ui/extended/**/*.slt' --engine postgres-extended --override
```
Please note that the minimum required version of `sqllogictest` is 0.18 or higher.
18 changes: 18 additions & 0 deletions e2e_test/error_ui/extended/main.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
query error
selet 1;
----
db error: ERROR: Failed to prepare the statement

Caused by:
sql parser error: Expected an SQL statement, found: selet at line:1, column:6
Near "selet"


query error
select 1/0;
----
db error: ERROR: Failed to execute the statement

Caused by these errors (recent errors listed first):
1: Expr error
2: Division by zero
20 changes: 15 additions & 5 deletions e2e_test/error_ui/main.slt → e2e_test/error_ui/simple/main.slt
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
query error
selet 1;
----
db error: ERROR: Failed to run the query

Caused by:
sql parser error: Expected an SQL statement, found: selet at line:1, column:6
Near "selet"


statement error
create function int_42() returns int as int_42 using link 'localhost:8815';
----
db error: ERROR: QueryError
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: failed to connect to UDF service
Expand All @@ -13,7 +23,7 @@ Caused by these errors (recent errors listed first):
statement error
alter system set not_exist_key to value;
----
db error: ERROR: QueryError
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: gRPC request to meta service failed: Internal error
Expand All @@ -23,7 +33,7 @@ Caused by these errors (recent errors listed first):
query error
select v1 + v2 = v3;
----
db error: ERROR: QueryError
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Failed to bind expression: v1 + v2 = v3
Expand All @@ -33,7 +43,7 @@ Caused by these errors (recent errors listed first):
query error
select 1/0;
----
db error: ERROR: QueryError
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
Expand All @@ -43,7 +53,7 @@ Caused by these errors (recent errors listed first):
query error
select x/0 from generate_series(1, 3) as g(x);
----
db error: ERROR: QueryError
db error: ERROR: Failed to run the query

Caused by these errors (recent errors listed first):
1: Expr error
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/source/cdc/cdc.check_new_rows.slt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ select v1, v2, v3 from mytable order by v1;
query I
SELECT * from products_test_cnt
----
11
12

query I
SELECT * from orders_test_cnt
Expand Down
Loading

0 comments on commit a1eaf84

Please sign in to comment.