-
Notifications
You must be signed in to change notification settings - Fork 275
GizmoSQL: switch from gizmosqlline (Java) to gizmosql_client #863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ export HOME=/home/ubuntu | |
|
|
||
| # Install requirements | ||
| apt-get update -y | ||
| apt install openjdk-17-jre-headless unzip netcat-openbsd -y | ||
| apt install unzip netcat-openbsd -y | ||
|
|
||
| # Detect architecture (maps x86_64->amd64, aarch64->arm64) | ||
| ARCH=$(uname -m) | ||
|
|
@@ -15,40 +15,25 @@ elif [ "$ARCH" = "aarch64" ]; then | |
| ARCH="arm64" | ||
| fi | ||
|
|
||
| # Server setup Install | ||
| # Install the GizmoSQL server and client (gizmosql_client is the CLI shell) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. L. 21: Please don't copy binaries into
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @rschu1ze - this should be fixed now. |
||
| curl -L -o gizmosql.zip "https://github.com/gizmodata/gizmosql/releases/latest/download/gizmosql_cli_linux_${ARCH}.zip" | ||
| unzip gizmosql.zip | ||
| mv gizmosql_server gizmosql_client /usr/local/bin/ | ||
|
|
||
| # Install Java and the GizmoSQLLine CLI client | ||
| pushd /tmp | ||
| curl -L -o gizmosqlline https://github.com/gizmodata/gizmosqlline/releases/latest/download/gizmosqlline | ||
| chmod +x gizmosqlline | ||
| mv gizmosqlline /usr/local/bin/ | ||
| popd | ||
|
|
||
| # Source our env vars and utility functions for starting/stopping gizmosql server | ||
| . util.sh | ||
|
|
||
| # Start the GizmoSQL server in the background | ||
| start_gizmosql | ||
|
|
||
| # Create the table | ||
| gizmosqlline \ | ||
| -u ${GIZMOSQL_SERVER_URI} \ | ||
| -n ${GIZMOSQL_USERNAME} \ | ||
| -p ${GIZMOSQL_PASSWORD} \ | ||
| -f create.sql | ||
| gizmosql_client --file create.sql | ||
|
|
||
| # Load the data | ||
| ../download-hits-parquet-single | ||
|
|
||
| echo -n "Load time: " | ||
| time gizmosqlline \ | ||
| -u ${GIZMOSQL_SERVER_URI} \ | ||
| -n ${GIZMOSQL_USERNAME} \ | ||
| -p ${GIZMOSQL_PASSWORD} \ | ||
| -f load.sql | ||
| time gizmosql_client --file load.sql | ||
|
|
||
| stop_gizmosql | ||
|
|
||
|
|
@@ -62,8 +47,8 @@ echo -n "Data size: " | |
| wc -c clickbench.db | ||
|
|
||
| cat log.txt | \ | ||
| grep -E 'rows? selected \([0-9.]+ seconds\)|Killed|Segmentation' | \ | ||
| sed -E 's/.*rows? selected \(([0-9.]+) seconds\).*/\1/; s/.*(Killed|Segmentation).*/null/' | \ | ||
| grep -E 'Run Time: [0-9.]+s|Killed|Segmentation' | \ | ||
| sed -E 's/.*Run Time: ([0-9.]+)s.*/\1/; s/.*(Killed|Segmentation).*/null/' | \ | ||
| awk '{ | ||
| if (NR % 3 == 1) printf "["; | ||
| if ($1 == "null") printf "null"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,10 @@ for query in "${queries[@]}"; do | |
| # Start the GizmoSQL server | ||
| start_gizmosql | ||
|
|
||
| # Enable timer and discard result rows (we only care about Run Time) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change l. 22 to I got
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done - thanks! |
||
| echo ".timer on" >> "${TEMP_SQL_FILE}" | ||
| echo ".mode trash" >> "${TEMP_SQL_FILE}" | ||
|
|
||
| # Add a comment to identify the query in the output | ||
| echo "-- Query: ${query}" >> "${TEMP_SQL_FILE}" | ||
|
|
||
|
|
@@ -32,12 +36,8 @@ for query in "${queries[@]}"; do | |
| echo "${query}" >> "${TEMP_SQL_FILE}" | ||
| done | ||
|
|
||
| # Execute the query script | ||
| gizmosqlline \ | ||
| -u ${GIZMOSQL_SERVER_URI} \ | ||
| -n ${GIZMOSQL_USERNAME} \ | ||
| -p ${GIZMOSQL_PASSWORD} \ | ||
| -f "${TEMP_SQL_FILE}" | ||
| # Execute the query script (timer output goes to stderr; merge to stdout) | ||
| gizmosql_client --file "${TEMP_SQL_FILE}" 2>&1 | ||
|
|
||
| # Stop the server before next query | ||
| stop_gizmosql | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L. 7 and 8 need
sudo, please check the other invocations ofaptin the repository.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @rschu1ze - this should be fixed now.