From 91968424af2a7985d620ba48f0dd96f8926a9255 Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 27 May 2013 14:49:16 -0700 Subject: [PATCH 1/8] Fix compile issue on modern linux. --- config.h | 3 +++ 1 file changed, 3 insertions(+) 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 From 10493ea2ef597d99547ad8188f5a1f397cfdffd1 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 14 Sep 2013 12:46:13 -0700 Subject: [PATCH 2/8] Update README --- README | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README b/README index 547195d..96a2cf8 100644 --- a/README +++ b/README @@ -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 From ff20f787e40299293b3499814a94158d2b7d1027 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 14 Sep 2013 12:47:08 -0700 Subject: [PATCH 3/8] rename readme --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 56a899feb15c8d7c81c581a92d5751eb74ccceac Mon Sep 17 00:00:00 2001 From: greenlion Date: Sat, 12 Oct 2013 16:04:05 -0700 Subject: [PATCH 4/8] no need to fdopen() --- bm_utils.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bm_utils.c b/bm_utils.c index 5da29a0..3c10f01 100644 --- a/bm_utils.c +++ b/bm_utils.c @@ -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); From 37a0078766d2f90bf500eaa80fef81d7c9ad6d22 Mon Sep 17 00:00:00 2001 From: greenlion Date: Sat, 12 Oct 2013 20:46:48 -0700 Subject: [PATCH 5/8] overwrite fiels --- bm_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bm_utils.c b/bm_utils.c index 3c10f01..e01fe09 100644 --- a/bm_utils.c +++ b/bm_utils.c @@ -376,10 +376,10 @@ tbl_open(int tbl, char *mode) } 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)) { From a8dc5e91967e1cd81288c6420ae9dfa8828cee3b Mon Sep 17 00:00:00 2001 From: greenlion Date: Sat, 12 Oct 2013 20:50:44 -0700 Subject: [PATCH 6/8] Fix issue with last commit --- bm_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bm_utils.c b/bm_utils.c index e01fe09..6194909 100644 --- a/bm_utils.c +++ b/bm_utils.c @@ -374,9 +374,9 @@ 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); } */ From 05178a80ad18858c25654121ec9a9bdbcba4d6e4 Mon Sep 17 00:00:00 2001 From: Justin Swanhart Date: Mon, 27 Apr 2015 14:28:25 -0400 Subject: [PATCH 7/8] Fix buffer overflow --- shared.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ From d006a6c49ff1a145a7d4ac7d837427627b213091 Mon Sep 17 00:00:00 2001 From: Justin Swanhart Date: Sun, 5 Jul 2020 15:58:44 -0400 Subject: [PATCH 8/8] Add a shell script to generate (and backup existing data if exists) data set for a given scale factor --- gendata | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 gendata 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 +