diff --git a/README b/README.md similarity index 84% rename from README rename to README.md index 547195d..96a2cf8 100644 --- a/README +++ b/README.md @@ -1,4 +1,19 @@ -Note: In our research paper we use the SSB instead of SSBM +Star Schema Benchmark data generator +== + +This branch has been updated to fix building of the utility on Linux. + +Original problems with the utility remain, such as crashes. +Generate each table individually: +* ./dbgen -s 10 -T s +* ./dbgen -s 10 -T d +* ./dbgen -s 10 -T p +* ./dbgen -s 10 -T c +* ./dbgen -s 10 -T l + +Original Readme +-- +Note: In ~~our research paper we~~~ the original paper the authors use the SSB instead of SSBM Version of 2/28/10: Cardinality of supplier fixed to follow benchmark spec: now 2000*SF (previously was 10000*SF, in error): line 226, driver.c diff --git a/bm_utils.c b/bm_utils.c index 5da29a0..6194909 100644 --- a/bm_utils.c +++ b/bm_utils.c @@ -374,12 +374,12 @@ tbl_open(int tbl, char *mode) fprintf(stderr, "stat(%s) failed.\n", fullpath); exit(-1); } - if (S_ISREG(fstats.st_mode) && !force && *mode != 'r' ) + /*if (S_ISREG(fstats.st_mode) && !force && *mode != 'r' ) { - sprintf(prompt, "Do you want to overwrite %s ?", fullpath); + sprintf(prompt, "Do you want to overwrite %s ?", fullpath); if (!yes_no(prompt)) exit(0); - } + } */ if (S_ISFIFO(fstats.st_mode)) { @@ -389,17 +389,7 @@ tbl_open(int tbl, char *mode) } else{ -#ifdef LINUX - /* allow large files on Linux */ - /*use open to first to get the in fd and apply regular fdopen*/ - - /*cheng: Betty mentioned about write mode problem here, added 066*/ - retcode = - open(fullpath, ((*mode == 'r')?O_RDONLY:O_WRONLY)|O_CREAT|O_LARGEFILE,0644); - f = fdopen(retcode, mode); -#else f = fopen(fullpath, mode); -#endif } OPEN_CHECK(f, fullpath); diff --git a/config.h b/config.h index 91833cb..dbdffe0 100644 --- a/config.h +++ b/config.h @@ -47,6 +47,9 @@ * SYBASE -- use Sybase dialect in QGEN * TDAT -- use Teradata dialect in QGEN */ +#ifndef pid_t +#include +#endif #ifdef DOS #define DSS_PROC 1 diff --git a/gendata b/gendata new file mode 100755 index 0000000..3370137 --- /dev/null +++ b/gendata @@ -0,0 +1,27 @@ +#!/bin/bash +set -e +if [ "$1" = "" ]; then + echo "No scale factor provided. Using scale factor 1." + echo "To use another scale factor use $0 X where X is an integer value between 1 and 1000" + SIZE=1 +else + SIZE=$1 +fi; +if [ -e lineorder.tbl ]; then + echo "Backing up existing data set" + TS=$(date '+%s') + BACKUPDIR="backup.$TS" + mkdir $BACKUPDIR + mv *.tbl $BACKUPDIR + echo "Backup completed" +fi; +echo "Generating new data set of scale factor $SIZE" +./dbgen -s $SIZE -T l > /dev/null 2>&1 & +./dbgen -s $SIZE -T c > /dev/null 2>&1 & +./dbgen -s $SIZE -T d > /dev/null 2>&1 & +./dbgen -s $SIZE -T p > /dev/null 2>&1 & +./dbgen -s $SIZE -T s > /dev/null 2>&1 & +wait +echo "Data generation completed!" +du -sh *.tbl + diff --git a/shared.h b/shared.h index c1c18ce..606f062 100644 --- a/shared.h +++ b/shared.h @@ -117,7 +117,7 @@ #define PHONE_LEN 15 #ifdef SSBM -#define MAXAGG_LEN 10 /* max component length for a agg str */ +#define MAXAGG_LEN 20 /* max component length for a agg str */ #else #define MAXAGG_LEN 20 /* max component length for a agg str */