Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Oct 14, 2024
1 parent 99c88c4 commit a251518
Show file tree
Hide file tree
Showing 41 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions e2e_test/source_legacy/basic/scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
This folder contains scripts to prepare data for testing sources.

## Kafka

`e2e_test/source_legacy/basic/scripts/test_data` contains the data. Filename's convention is `<topic_name>.<n_partitions>`.

- If `<topic_name>` ends with `bin`, the whole file is a message with binary data.
- If `<topic_name>` ends with `avro_json` or `json_schema`:
- The first line is the schema. Key and value are separated by `^`.
- The rest of the lines are messages in JSON format. Key and value are separated by `^`.
- Produced to Kafka with `schema_registry_producer.py` (serialized to Avro or JSON)
- Otherwise, each line is a message, and key/value is separated by `^`.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
set -e

SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
cd "$SCRIPT_PATH/.." || exit 1
# cwd is /scripts
# SCRIPT_PATH is e2e_test/source_legacy/kafka/script/
# cwd is e2e_test/source_legacy/kafka/

echo "$SCRIPT_PATH"

source ../.risingwave/config/risedev-env
source ../../../.risingwave/config/risedev-env

if [ "$1" == "compress" ]; then
echo "Compress test_data/ into test_data.zip"
cd ./source
cd ./script
zip_file=test_data.zip
if [ -f "$zip_file" ]; then
rm "$zip_file"
Expand All @@ -23,7 +23,7 @@ if [ "$1" == "compress" ]; then
fi

echo "--- Extract data for Kafka"
cd ./source/
cd ./script/
mkdir -p ./test_data/ch_benchmark/
unzip -o test_data.zip -d .
cd ..
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This folder contains scripts to prepare data for testing sources.

## Kafka

`scripts/source/test_data` contains the data. Filename's convention is `<topic_name>.<n_partitions>`.
`e2e_test/source_legacy/basic/scripts/test_data` contains the data. Filename's convention is `<topic_name>.<n_partitions>`.

- If `<topic_name>` ends with `bin`, the whole file is a message with binary data.
- If `<topic_name>` ends with `avro_json` or `json_schema`:
Expand Down

0 comments on commit a251518

Please sign in to comment.