Skip to content

Commit

Permalink
Merge pull request #670 from yaqi-zhao/master
Browse files Browse the repository at this point in the history
Add Support for oceanbase tpch
  • Loading branch information
abondvt89 committed Feb 27, 2024
2 parents a4fa252 + 0b8dc68 commit c78d9f4
Show file tree
Hide file tree
Showing 9 changed files with 548 additions and 101 deletions.
6 changes: 5 additions & 1 deletion config/mysql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<mysql_ssl_cert>client-cert.pem</mysql_ssl_cert>
<mysql_ssl_key>client-key.pem</mysql_ssl_key>
<mysql_ssl_cipher>server</mysql_ssl_cipher>
<mysql_oceanbase_port>2881</mysql_oceanbase_port>
</connection>
<tpcc>
<schema>
Expand Down Expand Up @@ -46,10 +47,13 @@
<schema>
<mysql_scale_fact>1</mysql_scale_fact>
<mysql_tpch_user>root</mysql_tpch_user>
<mysql_ob_tenant_name>tpch</mysql_ob_tenant_name>
<mysql_tpch_pass>mysql</mysql_tpch_pass>
<mysql_tpch_dbase>tpch</mysql_tpch_dbase>
<mysql_num_tpch_threads>1</mysql_num_tpch_threads>
<mysql_tpch_storage_engine>innodb</mysql_tpch_storage_engine>
<mysql_tpch_obcompat>false</mysql_tpch_obcompat>
<mysql_ob_partition_num>1</mysql_ob_partition_num>
<mysql_tpch_storage_engine>innodb</mysql_tpch_storage_engine>
</schema>
<driver>
<mysql_total_querysets>1</mysql_total_querysets>
Expand Down
16 changes: 16 additions & 0 deletions scripts/tcl/oceanbase/tproch/ob_tproch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export TMP=`pwd`/TMP
mkdir -p $TMP

echo "BUILD HAMMERDB SCHEMA"
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
./hammerdbcli auto ./scripts/tcl/oceanbase/tproch/ob_tproch_buildschema.tcl
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
echo "RUN HAMMERDB TEST"
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
./hammerdbcli auto ./scripts/tcl/oceanbase/tproch/ob_tproch_run.tcl
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
echo "DROP HAMMERDB SCHEMA"
./hammerdbcli auto ./scripts/tcl/oceanbase/tproch/ob_tproch_deleteschema.tcl
echo "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
echo "HAMMERDB RESULT"
./hammerdbcli auto ./scripts/tcl/oceanbase/tproch/ob_tproch_result.tcl
22 changes: 22 additions & 0 deletions scripts/tcl/oceanbase/tproch/ob_tproch_buildschema.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/tclsh

puts "SETTING CONFIGURATION"
dbset db mysql
dbset bm TPC-H

diset connection mysql_host 127.0.0.1
diset connection mysql_port 2881
diset connection mysql_socket /tmp/mysql.sock

diset tpch mysql_scale_fact 1
diset tpch mysql_num_tpch_threads [ numberOfCPUs ]
diset tpch mysql_tpch_user root
diset tpch mysql_tpch_pass 123
diset tpch mysql_tpch_dbase tpch
diset tpch mysql_tpch_obcompat true
diset tpch ob_partition_num 1
diset tpch ob_tenant_name hmdb
diset tpch mysql_tpch_storage_engine innodb
puts "SCHEMA BUILD STARTED"
buildschema
puts "SCHEMA BUILD COMPLETED"
19 changes: 19 additions & 0 deletions scripts/tcl/oceanbase/tproch/ob_tproch_deleteschema.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/tclsh

puts "SETTING CONFIGURATION"
dbset db mysql
dbset bm TPC-H

diset connection mysql_host 127.0.0.1
diset connection mysql_port 2881
diset connection mysql_socket /tmp/mysql.sock

diset tpch mysql_tpch_user root
diset tpch mysql_tpch_pass 123
diset tpch mysql_tpch_dbase tpch
diset tpch mysql_tpch_obcompat true
diset tpch ob_partition_num 1
diset ob_tenant_name hmdb
puts " DROP SCHEMA STARTED"
deleteschema
puts "DROP SCHEMA COMPLETED"
3 changes: 3 additions & 0 deletions scripts/tcl/oceanbase/tproch/ob_tproch_result.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set tmpdir $::env(TMP)
set ::outputfile $tmpdir/mysql_tproch
source ./scripts/tcl/generic/generic_tproch_result.tcl
30 changes: 30 additions & 0 deletions scripts/tcl/oceanbase/tproch/ob_tproch_run.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/tclsh

set tmpdir $::env(TMP)
puts "SETTING CONFIGURATION"
dbset db mysql
dbset bm TPC-H

diset mysql_host 127.0.0.1
diset connection mysql_port 2881
diset connection mysql_socket /tmp/mysql.sock

diset tpch mysql_scale_fact 1
diset tpch mysql_tpch_user root
diset tpch mysql_tpch_pass 123
diset tpch mysql_tpch_dbase tpch
diset tpch mysql_tpch_obcompat true
diset tpch ob_partition_num 1
diset tpch ob_tenant_name hmdb
diset tpch mysql_tpch_storage_engine innodb

loadscript
puts "TEST STARTED"
vuset vu 1
vucreate
set jobid [ vurun ]
vudestroy
puts "TEST COMPLETE"
set of [ open $tmpdir/mysql_tproch w ]
puts $of $jobid
close $of
Loading

0 comments on commit c78d9f4

Please sign in to comment.