@@ -9,10 +9,10 @@ db=${1:-"tpch_test"}
99force=${2:- " 1" }
1010
1111if [ " $force " == " 0" ]; then
12- table_exists=$( echo " SELECT COUNT() FROM system.tables WHERE database = '${db} ' AND name = 'nation'" | $BENDSQL_CLIENT_CONNECT --output tsv)
12+ table_exists=$( echo " SELECT COUNT() FROM system.tables WHERE database = '${db} ' AND name = 'nation'" | bendsql_connect_root --output tsv)
1313 table_exists=$( echo " $table_exists " | tr -d ' \r\n[:space:]' )
1414 if [ -n " $table_exists " ] && [ " $table_exists " -gt 0 ]; then
15- res=$( echo " SELECT COUNT() from ${db} .nation" | $BENDSQL_CLIENT_CONNECT --output tsv)
15+ res=$( echo " SELECT COUNT() from ${db} .nation" | bendsql_connect_root --output tsv)
1616 res=$( echo " $res " | tr -d ' \r\n[:space:]' )
1717 if [ -n " $res " ] && [ " $res " -gt 0 ]; then
1818 echo " Table $db .nation already exists and is not empty, size: ${res} . Use force=1 to override it."
@@ -21,11 +21,11 @@ if [ "$force" == "0" ]; then
2121 fi
2222fi
2323
24- echo " DROP DATABASE if EXISTS ${db} " | $BENDSQL_CLIENT_CONNECT
25- echo " CREATE DATABASE ${db} " | $BENDSQL_CLIENT_CONNECT
24+ echo " DROP DATABASE if EXISTS ${db} " | bendsql_connect_root
25+ echo " CREATE DATABASE ${db} " | bendsql_connect_root
2626
2727for t in customer lineitem nation orders partsupp part region supplier; do
28- echo " DROP TABLE IF EXISTS ${db} .$t " | $BENDSQL_CLIENT_CONNECT
28+ echo " DROP TABLE IF EXISTS ${db} .$t " | bendsql_connect_root
2929done
3030
3131# create tpch tables
@@ -35,14 +35,14 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.nation
3535 n_name STRING not null,
3636 n_regionkey INTEGER not null,
3737 n_comment STRING
38- ) CLUSTER BY (n_nationkey)" | $BENDSQL_CLIENT_CONNECT
38+ ) CLUSTER BY (n_nationkey)" | bendsql_connect_root
3939
4040echo " CREATE TABLE IF NOT EXISTS ${db} .region
4141(
4242 r_regionkey INTEGER not null,
4343 r_name STRING not null,
4444 r_comment STRING
45- ) CLUSTER BY (r_regionkey)" | $BENDSQL_CLIENT_CONNECT
45+ ) CLUSTER BY (r_regionkey)" | bendsql_connect_root
4646
4747echo " CREATE TABLE IF NOT EXISTS ${db} .part
4848(
@@ -55,7 +55,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.part
5555 p_container STRING not null,
5656 p_retailprice DECIMAL(15, 2) not null,
5757 p_comment STRING not null
58- ) CLUSTER BY (p_partkey)" | $BENDSQL_CLIENT_CONNECT
58+ ) CLUSTER BY (p_partkey)" | bendsql_connect_root
5959
6060echo " CREATE TABLE IF NOT EXISTS ${db} .supplier
6161(
@@ -66,7 +66,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.supplier
6666 s_phone STRING not null,
6767 s_acctbal DECIMAL(15, 2) not null,
6868 s_comment STRING not null
69- ) CLUSTER BY (s_suppkey)" | $BENDSQL_CLIENT_CONNECT
69+ ) CLUSTER BY (s_suppkey)" | bendsql_connect_root
7070
7171echo " CREATE TABLE IF NOT EXISTS ${db} .partsupp
7272(
@@ -75,7 +75,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.partsupp
7575 ps_availqty BIGINT not null,
7676 ps_supplycost DECIMAL(15, 2) not null,
7777 ps_comment STRING not null
78- ) CLUSTER BY (ps_partkey)" | $BENDSQL_CLIENT_CONNECT
78+ ) CLUSTER BY (ps_partkey)" | bendsql_connect_root
7979
8080echo " CREATE TABLE IF NOT EXISTS ${db} .customer
8181(
@@ -87,7 +87,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.customer
8787 c_acctbal DECIMAL(15, 2) not null,
8888 c_mktsegment STRING not null,
8989 c_comment STRING not null
90- ) CLUSTER BY (c_custkey)" | $BENDSQL_CLIENT_CONNECT
90+ ) CLUSTER BY (c_custkey)" | bendsql_connect_root
9191
9292echo " CREATE TABLE IF NOT EXISTS ${db} .orders
9393(
@@ -100,7 +100,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.orders
100100 o_clerk STRING not null,
101101 o_shippriority INTEGER not null,
102102 o_comment STRING not null
103- ) CLUSTER BY (o_orderkey, o_orderdate)" | $BENDSQL_CLIENT_CONNECT
103+ ) CLUSTER BY (o_orderkey, o_orderdate)" | bendsql_connect_root
104104
105105echo " CREATE TABLE IF NOT EXISTS ${db} .lineitem
106106(
@@ -120,7 +120,7 @@ echo "CREATE TABLE IF NOT EXISTS ${db}.lineitem
120120 l_shipinstruct STRING not null,
121121 l_shipmode STRING not null,
122122 l_comment STRING not null
123- ) CLUSTER BY(l_shipdate, l_orderkey)" | $BENDSQL_CLIENT_CONNECT
123+ ) CLUSTER BY(l_shipdate, l_orderkey)" | bendsql_connect_root
124124
125125# import data
126126CURDIR=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
0 commit comments