Skip to content

Commit caa02d2

Browse files
committed
feat: update schema and load shell script
1 parent 7f7b164 commit caa02d2

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,14 @@ cd shell
219219
# using the github cassandra-loader
220220
wget https://github.com/brianmhess/cassandra-loader/releases/download/v0.0.27/cassandra-loader
221221

222-
./cassandra-loader -f project_files/data_files/warehouse.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.warehouse(w_id, w_zip, w_name, w_street_1, w_street_2, w_city, w_state, w_tax, w_ytd)"
223-
./cassandra-loader -f project_files/data_files/district.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.district(d_w_id, d_id, d_zip, d_name, d_street_1, d_street_2, d_city, d_state, d_tax, d_ytd, d_next_o_id)"
224-
./cassandra-loader -f project_files/data_files/item.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.item(i_id, i_name, i_price, i_im_id, i_data)"
225-
./cassandra-loader -f project_files/data_files/order.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424."order"(o_w_id, o_d_id, o_id, o_c_id, o_carrier_id, o_ol_cnt, o_all_local, o_entry_d)" -dateFormat "YYYY-MM-DD hh:mm:ss"
226-
./cassandra-loader -f project_files/data_files/order-line.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.orderline(ol_w_id, ol_d_id, ol_o_id, ol_number, ol_i_id, ol_delivery_d, ol_amount, ol_supply_w_id, ol_quantity, ol_dist_info)" -dateFormat "YYYY-MM-DD hh:mm:ss"
227-
./cassandra-loader -f project_files/data_files/customer.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.customer(c_w_id, c_d_id, c_id, c_zip, c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_phone, c_since, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_payment_cnt, c_delivery_cnt, c_data)" -dateFormat "YYYY-MM-DD hh:mm:ss"
228-
./cassandra-loader -f project_files/data_files/stock.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.stock(s_w_id, s_i_id, s_quantity, s_ytd, s_order_cnt, s_remote_cnt, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10, s_data)"
229-
./cassandra-loader -f project_files/data_files/customer-balance.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.customerbalance(c_id, c_w_id, c_d_id, c_balance, c_first, c_middle, c_last, w_name, d_name)"
230-
./cassandra-loader -f project_files/data_files/order-by-customer.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.orderbycustomer(c_w_id, c_d_id, c_id, o_entry_d, c_first, c_middle, c_last, c_balance, c_last_o_id, o_carrier_id)" -dateFormat "YYYY-MM-DD hh:mm:ss"
231-
./cassandra-loader -f project_files/data_files/order-line-quantity-by-order.csv -host xcnd5.comp.nus.edu.sg -port 9142 -schema "cs5424.orderlinequantitybyorder(w_id, d_id, o_id, ol_quantity_map, items_id_name_map, c_id, o_entry_d, c_first, c_middle, c_last)" -dateFormat "YYYY-MM-DD hh:mm:ss"
222+
./cassandra-loader -f project_files/data_files/warehouse.csv -host localhost -schema "cs5424.warehouse(w_id, w_zip, w_name, w_street_1, w_street_2, w_city, w_state, w_tax, w_ytd)"
223+
./cassandra-loader -f project_files/data_files/district.csv -host localhost -schema "cs5424.district(d_w_id, d_id, d_zip, d_name, d_street_1, d_street_2, d_city, d_state, d_tax, d_ytd, d_next_o_id)"
224+
./cassandra-loader -f project_files/data_files/item.csv -host localhost -schema "cs5424.item(i_id, i_name, i_price, i_im_id, i_data)"
225+
./cassandra-loader -f project_files/data_files/order.csv -host localhost -schema "cs5424."order"(o_w_id, o_d_id, o_id, o_c_id, o_carrier_id, o_ol_cnt, o_all_local, o_entry_d)" -dateFormat "YYYY-MM-DD hh:mm:ss"
226+
./cassandra-loader -f project_files/data_files/order-line.csv -host localhost -schema "cs5424.orderline(ol_w_id, ol_d_id, ol_o_id, ol_number, ol_i_id, ol_delivery_d, ol_amount, ol_supply_w_id, ol_quantity, ol_dist_info)" -dateFormat "YYYY-MM-DD hh:mm:ss"
227+
./cassandra-loader -f project_files/data_files/customer.csv -host localhost -schema "cs5424.customer(c_w_id, c_d_id, c_id, c_zip, c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_phone, c_since, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_payment_cnt, c_delivery_cnt, c_data)" -dateFormat "YYYY-MM-DD hh:mm:ss"
228+
./cassandra-loader -f project_files/data_files/stock.csv -host localhost -schema "cs5424.stock(s_w_id, s_i_id, s_quantity, s_ytd, s_order_cnt, s_remote_cnt, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10, s_data)"
229+
./cassandra-loader -f project_files/data_files/customer-balance.csv -host localhost -schema "cs5424.customerbalance(c_w_id, c_d_id, c_id, c_balance, c_first, c_middle, c_last, w_name, d_name)"
230+
./cassandra-loader -f project_files/data_files/order-by-customer.csv -host localhost -schema "cs5424.orderbycustomer(c_w_id, c_d_id, c_id, o_entry_d, c_first, c_middle, c_last, c_balance, c_last_o_id, o_carrier_id)" -dateFormat "YYYY-MM-DD hh:mm:ss"
231+
./cassandra-loader -f project_files/data_files/order-line-quantity-by-order.csv -host localhost -schema "cs5424.orderlinequantitybyorder(w_id, d_id, o_id, ol_quantity_map, items_id_name_map, c_id, o_entry_d, c_first, c_middle, c_last)" -dateFormat "YYYY-MM-DD hh:mm:ss"
232232
```

benchmark/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ def handler(s, nub):
159159
latency_list.append(latency)
160160
# print response content at stdout
161161
print(response)
162+
else:
163+
pass
162164
print(str(nub) + "," + str(requests_counter) + "," + str(time_counter) + "," + str(requests_counter / time_counter )
163165
+ "," + str(np.mean(latency_list * 1000)) + "," + str(np.median(latency_list) * 1000) + "," + str(np.percentile(latency_list, 95) * 1000) + ","
164166
+ str(np.percentile(latency_list, 99) * 1000), file=sys.stderr)
@@ -179,7 +181,7 @@ def read_from_stdin():
179181

180182
def benchmark():
181183
threads = []
182-
for i in range(0, 20):
184+
for i in range(0, 5):
183185
threads.append(threading.Thread(target=handler, args=(read_from_file(i), i,)))
184186
for thread in threads:
185187
thread.start()

script/ycql.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ CREATE TABLE CS5424.Order (
2525
O_OL_CNT int,
2626
O_ALL_LOCAL int,
2727
O_ENTRY_D timestamp,
28-
PRIMARY KEY ((O_W_ID, O_D_ID), O_ID)
28+
PRIMARY KEY ((O_W_ID, O_D_ID), O_ID, O_CARRIER_ID)
2929
)
30-
WITH CLUSTERING ORDER By (O_ID DESC);
30+
WITH CLUSTERING ORDER By (O_ID DESC, O_CARRIER_ID DESC);
3131

3232
CREATE TABLE CS5424.OrderLine (
3333
OL_W_ID int,
@@ -70,7 +70,7 @@ CREATE TABLE CS5424.District (
7070
D_YTD double,
7171
D_NEXT_O_ID int,
7272
PRIMARY KEY ((D_W_ID), D_ID)
73-
);
73+
)
7474
WITH CLUSTERING ORDER By (D_ID DESC);
7575

7676
CREATE TABLE CS5424.Customer (
@@ -96,7 +96,7 @@ CREATE TABLE CS5424.Customer (
9696
C_DELIVERY_CNT int,
9797
C_DATA text,
9898
PRIMARY KEY ((C_W_ID, C_D_ID), C_ID)
99-
);
99+
)
100100
WITH CLUSTERING ORDER By (C_ID DESC);
101101

102102
CREATE TABLE CS5424.Stock (
@@ -132,9 +132,9 @@ CREATE TABLE CS5424.OrderByCustomer (
132132
C_BALANCE double,
133133
C_LAST_O_ID int,
134134
O_CARRIER_ID int,
135-
PRIMARY KEY ((C_W_ID, C_D_ID), C_ID, O_ENTRY_D)
135+
PRIMARY KEY ((C_W_ID, C_D_ID, C_ID), O_ENTRY_D)
136136
)
137-
WITH CLUSTERING ORDER BY (C_ID DESC, O_ENTRY_D DESC);
137+
WITH CLUSTERING ORDER BY (O_ENTRY_D DESC);
138138

139139
CREATE TABLE CS5424.CustomerBalance (
140140
C_W_ID int,

0 commit comments

Comments
 (0)