@@ -33,40 +33,32 @@ tar xf ./risingwave-connector.tar.gz -C ./connector-node
33
33
34
34
echo " --- starting risingwave cluster"
35
35
risedev ci-start ci-sink-test
36
- sleep 1
36
+ # Wait cassandra server to start
37
+ sleep 40
37
38
38
- echo " --- create cassandra table"
39
- curl https://downloads.apache.org/cassandra/4.1.3/apache-cassandra-4.1.3-bin.tar.gz --output apache-cassandra-4.1.3-bin.tar.gz
40
- tar xfvz apache-cassandra-4.1.3-bin.tar.gz
41
- # remove bundled packages, and use installed packages, because Python 3.12 has removed asyncore, but I failed to install libev support for bundled Python driver.
42
- rm apache-cassandra-4.1.3/lib/six-1.12.0-py2.py3-none-any.zip
43
- rm apache-cassandra-4.1.3/lib/cassandra-driver-internal-only-3.25.0.zip
44
- apt-get install -y libev4 libev-dev
45
- pip3 install --break-system-packages cassandra-driver
39
+ echo " --- install cassandra"
40
+ wget $( get_latest_cassandra_download_url) -O cassandra_latest.tar.gz
41
+ tar xfvz cassandra_latest.tar.gz
42
+ export LATEST_CASSANDRA_VERSION=$( get_latest_cassandra_version)
43
+ export CASSANDRA_DIR=" ./apache-cassandra-${LATEST_CASSANDRA_VERSION} "
44
+
45
+ # Cassandra only support python 3.11
46
+ apt-get install -y software-properties-common
47
+ add-apt-repository ppa:deadsnakes/ppa
48
+ apt-get update
49
+ apt-get install -y python3.11
50
+ apt-get install -y python3.11-venv
51
+ python3.11 -m venv cqlsh_env
52
+ source cqlsh_env/bin/activate
46
53
47
- cd apache-cassandra-4.1.3/bin
48
54
export CQLSH_HOST=cassandra-server
49
55
export CQLSH_PORT=9042
50
- ./cqlsh -e " CREATE KEYSPACE demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};use demo;
51
- CREATE table demo_bhv_table(v1 int primary key,v2 smallint,v3 bigint,v4 float,v5 double,v6 text,v7 date,v8 timestamp,v9 boolean);"
52
56
53
57
echo " --- testing sinks"
54
- cd ../../
55
58
sqllogictest -p 4566 -d dev ' ./e2e_test/sink/cassandra_sink.slt'
56
- sleep 1
57
- cd apache-cassandra-4.1.3/bin
58
- ./cqlsh -e " COPY demo.demo_bhv_table TO './query_result.csv' WITH HEADER = false AND ENCODING = 'UTF-8';"
59
59
60
- if cat ./query_result.csv | awk -F " ," ' {
61
- exit !($1 == 1 && $2 == 1 && $3 == 1 && $4 == 1.1 && $5 == 1.2 && $6 == "test" && $7 == "2013-01-01" && $8 == "2013-01-01 01:01:01.000+0000" && $9 == "False\r"); }' ; then
62
- echo " Cassandra sink check passed"
63
- else
64
- echo " The output is not as expected."
65
- echo " output:"
66
- cat ./query_result.csv
67
- exit 1
68
- fi
60
+ deactivate
69
61
70
62
echo " --- Kill cluster"
71
63
cd ../../
72
- risedev ci-kill
64
+ risedev ci-kill
0 commit comments