-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into xxh/clickhouse_sink_rust_new
- Loading branch information
Showing
301 changed files
with
8,913 additions
and
3,444 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ca | |
RUN cargo binstall -y --no-symlinks cargo-llvm-cov cargo-nextest cargo-hakari cargo-sort cargo-cache cargo-audit \ | ||
[email protected] \ | ||
&& cargo install sccache --locked \ | ||
&& cargo install [email protected].1 --locked \ | ||
&& cargo install [email protected].2 --locked \ | ||
&& cargo cache -a \ | ||
&& rm -rf "/root/.cargo/registry/index" \ | ||
&& rm -rf "/root/.cargo/registry/cache" \ | ||
|
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
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
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,89 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exits as soon as any line fails. | ||
set -euo pipefail | ||
|
||
source ci/scripts/common.sh | ||
|
||
while getopts 'p:' opt; do | ||
case ${opt} in | ||
p ) | ||
profile=$OPTARG | ||
;; | ||
\? ) | ||
echo "Invalid Option: -$OPTARG" 1>&2 | ||
exit 1 | ||
;; | ||
: ) | ||
echo "Invalid option: $OPTARG requires an argument" 1>&2 | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND -1)) | ||
|
||
download_and_prepare_rw "$profile" source | ||
|
||
echo "--- starting risingwave cluster" | ||
mkdir -p .risingwave/log | ||
cargo make ci-start ci-iceberg-test | ||
sleep 1 | ||
|
||
# prepare minio iceberg sink | ||
echo "--- preparing iceberg" | ||
.risingwave/bin/mcli -C .risingwave/config/mcli mb hummock-minio/iceberg | ||
wget https://ci-deps-dist.s3.amazonaws.com/spark-3.3.1-bin-hadoop3.tgz | ||
tar -xf spark-3.3.1-bin-hadoop3.tgz --no-same-owner | ||
DEPENDENCIES=org.apache.iceberg:iceberg-spark-runtime-3.3_2.12:1.3.1,org.apache.hadoop:hadoop-aws:3.3.2 | ||
spark-3.3.1-bin-hadoop3/bin/spark-sql --packages $DEPENDENCIES \ | ||
--conf spark.sql.catalog.demo=org.apache.iceberg.spark.SparkCatalog \ | ||
--conf spark.sql.catalog.demo.type=hadoop \ | ||
--conf spark.sql.catalog.demo.warehouse=s3a://iceberg/ \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.endpoint=http://127.0.0.1:9301 \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.access.key=hummockadmin \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.secret.key=hummockadmin \ | ||
--S --e "CREATE TABLE demo.demo_db.demo_table(v1 int, v2 bigint, v3 string) TBLPROPERTIES ('format-version'='2');" | ||
|
||
# Used to create a snapshot in iceberg. | ||
# For now iceberg v2 sink can't support to insert in a new table without snapshot. | ||
# Fix it later. | ||
spark-3.3.1-bin-hadoop3/bin/spark-sql --packages $DEPENDENCIES \ | ||
--conf spark.sql.catalog.demo=org.apache.iceberg.spark.SparkCatalog \ | ||
--conf spark.sql.catalog.demo.type=hadoop \ | ||
--conf spark.sql.catalog.demo.warehouse=s3a://iceberg/ \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.endpoint=http://127.0.0.1:9301 \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.access.key=hummockadmin \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.secret.key=hummockadmin \ | ||
--S --e "INSERT INTO demo.demo_db.demo_table values (3,1,'b')" | ||
|
||
echo "--- testing sinks" | ||
sqllogictest -p 4566 -d dev './e2e_test/sink/iceberg_sink_v2.slt' | ||
sleep 1 | ||
|
||
# check sink destination iceberg | ||
spark-3.3.1-bin-hadoop3/bin/spark-sql --packages $DEPENDENCIES \ | ||
--conf spark.sql.catalog.demo=org.apache.iceberg.spark.SparkCatalog \ | ||
--conf spark.sql.catalog.demo.type=hadoop \ | ||
--conf spark.sql.catalog.demo.warehouse=s3a://iceberg/ \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.endpoint=http://127.0.0.1:9301 \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.access.key=hummockadmin \ | ||
--conf spark.sql.catalog.demo.hadoop.fs.s3a.secret.key=hummockadmin \ | ||
--S --e "INSERT OVERWRITE DIRECTORY './spark-output' USING CSV SELECT * FROM demo.demo_db.demo_table;" | ||
|
||
# check sink destination using shell | ||
if cat ./spark-output/*.csv | sort | awk -F "," '{ | ||
if ($1 == 1 && $2 == 50 && $3 == "1-50") c1++; | ||
if ($1 == 13 && $2 == 2 && $3 == "13-2") c2++; | ||
if ($1 == 21 && $2 == 2 && $3 == "21-2") c3++; | ||
if ($1 == 2 && $2 == 2 && $3 == "2-2") c4++; | ||
if ($1 == 3 && $2 == 2 && $3 == "3-2") c5++; | ||
if ($1 == 5 && $2 == 2 && $3 == "5-2") c6++; | ||
if ($1 == 8 && $2 == 2 && $3 == "8-2") c7++; } | ||
END { exit !(c1 == 1 && c2 == 1 && c3 == 1 && c4 == 1 && c5 == 1 && c6 == 1 && c7 == 1); }'; then | ||
echo "Iceberg sink check passed" | ||
else | ||
echo "The output is not as expected." | ||
exit 1 | ||
fi | ||
|
||
echo "--- Kill cluster" | ||
cargo make ci-kill |
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
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
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
Oops, something went wrong.