浏览代码

fixed error in tpch-setup.sh of inconsistent db names; made tpch suite osx compatible; fixed errors in runSuite.pl to use the db name as generated by tpch-setup.sh

Tim Harsch 11 年之前
父节点
当前提交
6334c1c082
共有 6 个文件被更改,包括 23 次插入6 次删除
  1. 1 0
      .gitignore
  2. 6 1
      runSuite.pl
  3. 0 2
      tpcds-gen/Makefile
  4. 3 1
      tpch-gen/Makefile
  5. 11 0
      tpch-gen/patches/Darwin/macosx.patch
  6. 2 2
      tpch-setup.sh

+ 1 - 0
.gitignore

@@ -1,4 +1,5 @@
 target/
 tpcds_kit.zip
+tpch_kit.zip
 *.sql.log
 derby.log

+ 6 - 1
runSuite.pl

@@ -24,10 +24,15 @@ if( $suite eq 'tpcds' ) {
 } # end if
 my @queries = glob '*.sql';
 
+my $db = { 
+	'tpcds' => 'tpcds_bin_partitioned_orc_2',
+	'tpch' => 'tpch_flat_orc_2'
+};
+
 print "filename,status,time,rows\n";
 for my $query ( @queries ) {
 	my $logname = "$query.log";
-	my $cmd="echo 'use tpcds_bin_partitioned_orc_2; source $query;' | hive -i testbench.settings 2>&1  | tee $query.log";
+	my $cmd="echo 'use $db->{${suite}}; source $query;' | hive -i testbench.settings 2>&1  | tee $query.log";
 	#print $cmd ; exit;
 	
 	my @hiveoutput=`$cmd`;

+ 0 - 2
tpcds-gen/Makefile

@@ -16,9 +16,7 @@ target/lib/dsdgen.jar: target/tools/dsdgen
 	cd target/; mkdir -p lib/; ( jar cvf lib/dsdgen.jar tools/ || gjar cvf lib/dsdgen.jar tools/ )
 
 target/tools/dsdgen: target/tpcds_kit.zip
-	pwd
 	test -d target/tools/ || (cd target; unzip tpcds_kit.zip; cd tools; cat ../../patches/all/*.patch | patch -p0 )
-	pwd
 	cd target/tools; cat ../../patches/${MYOS}/*.patch | patch -p1
 	cd target/tools; make clean; make dsdgen
 

+ 3 - 1
tpch-gen/Makefile

@@ -1,3 +1,4 @@
+MYOS=$(shell uname -s)
 
 all: target/lib/dbgen.jar target/tpch-gen-1.0-SNAPSHOT.jar
 
@@ -16,7 +17,8 @@ target/lib/dbgen.jar: target/tools/dbgen
 
 target/tools/dbgen: target/tpch_kit.zip
 	test -d target/tools/ || (cd target; unzip tpch_kit.zip -x __MACOSX/; ln -sf $$PWD/*/dbgen/ tools)
-	cd target/tools/; make -f makefile.suite clean; make -f makefile.suite CC=gcc DATABASE=ORACLE MACHINE=LINUX WORKLOAD=TPCH
+	cd target/tools; cat ../../../patches/${MYOS}/*.patch | patch -p0
+	cd target/tools; make -f makefile.suite clean; make -f makefile.suite CC=gcc DATABASE=ORACLE MACHINE=LINUX WORKLOAD=TPCH
 
 clean:
 	mvn clean

+ 11 - 0
tpch-gen/patches/Darwin/macosx.patch

@@ -0,0 +1,11 @@
+--- makefile.suite.orig	2014-06-25 15:40:27.000000000 -0700
++++ makefile.suite	2014-06-25 15:42:03.000000000 -0700
+@@ -110,7 +110,7 @@
+ MACHINE = 
+ WORKLOAD = 
+ #
+-CFLAGS	= -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64 
++CFLAGS	= -g -DDBNAME=\"dss\" -D$(MACHINE) -D$(DATABASE) -D$(WORKLOAD) -DRNG_TEST -D_FILE_OFFSET_BITS=64  -I/usr/include/malloc
+ LDFLAGS = -O
+ # The OBJ,EXE and LIB macros will need to be changed for compilation under
+ #  Windows NT

+ 2 - 2
tpch-setup.sh

@@ -67,12 +67,12 @@ runcommand "hive -i settings/load-flat.sql -f ddl-tpch/bin_flat/alltables.sql -d
 # Create the optimized tables.
 i=1
 total=8
-DATABASE=tpch_bin_partitioned_orc_${SCALE}
+DATABASE=tpch_flat_orc_${SCALE}
 for t in ${TABLES}
 do
 	echo "Optimizing table $t ($i/$total)."
 	COMMAND="hive -i settings/load-flat.sql -f ddl-tpch/bin_flat/${t}.sql \
-	    -d DB=tpch_bin_flat_orc_${SCALE} \
+	    -d DB=${DATABASE} \
 	    -d SOURCE=tpch_text_${SCALE} -d BUCKETS=${BUCKETS} \
 	    -d FILE=orc"
 	runcommand "$COMMAND"