Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
fix

fix

fix ci

fix
  • Loading branch information
xxhZs committed Jun 21, 2024
1 parent 98b6a19 commit fc8e201
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ci/scripts/e2e-clickhouse-sink-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ else
fi

echo "--- testing sinks upsert1"
./clickhouse client --host=clickhouse-server --port=9000 --query="select * from demo_test_upsert1 FORMAT CSV final;" > ./query_result2.csv
./clickhouse client --host=clickhouse-server --port=9000 --query="select * from demo_test_upsert1 final FORMAT CSV;" > ./query_result2.csv

if cat ./query_result2.csv | sort | awk -F "," '{
if ($1 == 2 && $2 == 2 && $3 == "\"2-2\"" && $4 == "2013-01-02 01:01:02+01:00" && $4 == 0) c2++;
if ($1 == 3 && $2 == 2 && $3 == "\"3-2\"" && $4 == "2013-01-03 01:01:02+01:00" && $4 == 0) c3++;
if ($1 == 2 && $2 == 2 && $3 == "\"2-2\"" && $4 == "\"2013-01-02 00:01:02.000\"" && $4 == 0) c2++;
if ($1 == 3 && $2 == 2 && $3 == "\"3-2\"" && $4 == "\"2013-01-03 00:01:02.000\"" && $4 == 0) c3++;
END { exit !(c2 == 1 && c3 == 1); }'; then
echo "Clickhouse sink check passed"
else
Expand All @@ -73,7 +73,7 @@ else
fi

echo "--- testing sinks upsert2"
./clickhouse client --host=clickhouse-server --port=9000 --query="select * from demo_test_upsert2 FORMAT CSV final;" > ./query_result3.csv
./clickhouse client --host=clickhouse-server --port=9000 --query="select * from demo_test_upsert2 final FORMAT CSV;" > ./query_result3.csv

if cat ./query_result2.csv | sort | awk -F "," '{
if ($1 == 2 && $2 == 2 && $3 == "\"2-2\"" && $3 == 1) c2++;
Expand Down
17 changes: 14 additions & 3 deletions e2e_test/sink/clickhouse_sink.slt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CREATE SINK s6 from t6 WITH (
connector = 'clickhouse',
type = 'append-only',
force_append_only='true',
clickhouse.url = 'http://127.0.0.1:8123',
clickhouse.url = 'http://clickhouse-server:8123',
clickhouse.user = 'default',
clickhouse.password = '',
clickhouse.database = 'default',
Expand All @@ -26,13 +26,15 @@ CREATE SINK s6 from t6 WITH (
statement ok
INSERT INTO t6 VALUES (1, 50, '1-50', 1, 1.1), (2, 2, '2-2', 2, 2.2), (3, 2, '3-2', 1, 3.3), (5, 2, '5-2', 2, 4.4), (8, 2, '8-2', 1, 'inf'), (13, 2, '13-2', 2, '-inf'), (21, 2, '21-2', 1, 'nan');

statement ok
FLUSH;

statement ok
CREATE SINK s7 from t7 WITH (
connector = 'clickhouse',
type = 'upsert',
primary_key = 'v1',
clickhouse.url = 'http://127.0.0.1:8123',
clickhouse.url = 'http://clickhouse-server:8123',
clickhouse.user = 'default',
clickhouse.password = '',
clickhouse.database = 'default',
Expand All @@ -43,15 +45,21 @@ CREATE SINK s7 from t7 WITH (
statement ok
INSERT INTO t7 VALUES (1, 50, '1-50', '2013-01-01 01:01:02+01:00'), (2, 2, '2-2', '2013-01-02 01:01:02+01:00'), (3, 2, '3-2','2013-01-03 01:01:02+01:00');

statement ok
FLUSH;

statement ok
delete from t7 where v1 = 1;

statement ok
FLUSH;

statement ok
CREATE SINK s8 from t8 WITH (
connector = 'clickhouse',
type = 'upsert',
primary_key = 'v1',
clickhouse.url = 'http://127.0.0.1:8123',
clickhouse.url = 'http://clickhouse-server:8123',
clickhouse.user = 'default',
clickhouse.password = '',
clickhouse.database = 'default',
Expand All @@ -62,6 +70,9 @@ CREATE SINK s8 from t8 WITH (
statement ok
INSERT INTO t8 VALUES (1, 50, '1-50'), (2, 2, '2-2'), (3, 2, '3-2');

statement ok
FLUSH;

statement ok
delete from t8 where v1 = 1;

Expand Down

0 comments on commit fc8e201

Please sign in to comment.