Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rbench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Braß
rbench
Commits
cda12829
Commit
cda12829
authored
5 years ago
by
Stefan Braß
Browse files
Options
Downloads
Patches
Plain Diff
db/load_data now does the tsv->sql conversion
parent
31685075
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/conv_sql
+12
-2
12 additions, 2 deletions
db/conv_sql
db/load_data
+27
-2
27 additions, 2 deletions
db/load_data
with
39 additions
and
4 deletions
db/conv_sql
+
12
−
2
View file @
cda12829
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# Project: ddbench - Deductive System and Database Benchmarks
# Project: ddbench - Deductive System and Database Benchmarks
# Filename: db/conv_sql
# Filename: db/conv_sql
# Purpose: AWK Script to Translate .tsv Benchmark Result to SQL
# Purpose: AWK Script to Translate .tsv Benchmark Result to SQL
# Last Change: 0
2.02
.2019
# Last Change: 0
4.10
.2019
# Language: Shellscript (bash)
# Language: Shellscript (bash)
# Author: Stefan Brass
# Author: Stefan Brass
# EMail: brass@informatik.uni-halle.de
# EMail: brass@informatik.uni-halle.de
...
@@ -70,6 +70,11 @@ FNR == 1 {
...
@@ -70,6 +70,11 @@ FNR == 1 {
n
=
split
(
FILENAME
,
path_parts
,
"/"
);
n
=
split
(
FILENAME
,
path_parts
,
"/"
);
arg
=
path_parts
[
n
];
arg
=
path_parts
[
n
];
dir
=
""
;
for
(
i
=
1
;
i
<
n
;
i
++
)
dir
=
(
dir
path_parts
[
i
]
"/"
);
#printf("Dir: '" dir "'\n");
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# Remove extension "tsv" (tab-separated-values) from input file:
# Remove extension "tsv" (tab-separated-values) from input file:
#----------------------------------------------------------------------
#----------------------------------------------------------------------
...
@@ -150,7 +155,12 @@ FNR == 1 {
...
@@ -150,7 +155,12 @@ FNR == 1 {
# Compute the output file name:
# Compute the output file name:
#----------------------------------------------------------------------
#----------------------------------------------------------------------
output
=
(
filename
[
1
]
".sql"
);
# Old version without directory prefix:
#output = (filename[1] ".sql");
# New version with directory prefix:
output
=
(
dir
filename
[
1
]
".sql"
);
#printf("Output: '" output "'\n");
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# Now we still have to check the column names in the first line:
# Now we still have to check the column names in the first line:
...
...
This diff is collapsed.
Click to expand it.
db/load_data
+
27
−
2
View file @
cda12829
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# Project: ddbench - Deductive System and Database Benchmarks
# Project: ddbench - Deductive System and Database Benchmarks
# Filename: db/load_data
# Filename: db/load_data
# Purpose: Shellscript to create database and load all data
# Purpose: Shellscript to create database and load all data
# Last Change:
19.03
.2019
# Last Change:
04.10
.2019
# Language: Shellscript (bash)
# Language: Shellscript (bash)
# Author: Stefan Brass
# Author: Stefan Brass
# EMail: brass@informatik.uni-halle.de
# EMail: brass@informatik.uni-halle.de
...
@@ -19,10 +19,17 @@
...
@@ -19,10 +19,17 @@
# Note that the tables and views of the database are dropped first
# Note that the tables and views of the database are dropped first
# to start from a clean state.
# to start from a clean state.
# It is normal that this generates errors on the first execution.
echo
"Dropping old versions of database tables and views."
echo
"It is normal that there are error messages about missing objects"
echo
"when the database is created for the first time."
echo
psql
-f
drop_db.sql
psql
-f
drop_db.sql
# Create Database Tables (Database Schema):
# Create Database Tables (Database Schema):
echo
echo
"Creating tables and views of the database."
echo
"It is normal that there are notices about implicitly created indexes."
echo
psql
-f
create_db.sql |
grep
-v
"INSERT 0 1"
psql
-f
create_db.sql |
grep
-v
"INSERT 0 1"
# Create Views:
# Create Views:
...
@@ -50,6 +57,9 @@ psql -f v_doc.sql # Print Table Data in Markdown Format (->Documentation)
...
@@ -50,6 +57,9 @@ psql -f v_doc.sql # Print Table Data in Markdown Format (->Documentation)
psql
-f
v_scripts.sql
# Support for Benchmark Execution Scripts
psql
-f
v_scripts.sql
# Support for Benchmark Execution Scripts
# Basic Data:
# Basic Data:
echo
echo
"Loading basic data about machines, benchmarks, systems, and input files."
echo
psql
-f
machines.sql |
grep
-v
"INSERT 0 1"
psql
-f
machines.sql |
grep
-v
"INSERT 0 1"
psql
-f
input_types.sql |
grep
-v
"INSERT 0 1"
psql
-f
input_types.sql |
grep
-v
"INSERT 0 1"
psql
-f
benchmarks.sql |
grep
-v
"INSERT 0 1"
psql
-f
benchmarks.sql |
grep
-v
"INSERT 0 1"
...
@@ -85,8 +95,23 @@ psql -f graph_types.sql | grep -v "INSERT 0 1"
...
@@ -85,8 +95,23 @@ psql -f graph_types.sql | grep -v "INSERT 0 1"
psql
-f
input_graphs.sql |
grep
-v
"INSERT 0 1"
psql
-f
input_graphs.sql |
grep
-v
"INSERT 0 1"
psql
-f
input_join1.sql |
grep
-v
"INSERT 0 1"
psql
-f
input_join1.sql |
grep
-v
"INSERT 0 1"
# Convert tsv-files with benchmark results to SQL:
# (might be unnecessary, if the SQL files already exist, but is safer,
# because SQL files might be missing or outdated)
echo
echo
"Converting tsv-files with benchmark results to SQL INSERT statements."
echo
for
FILE
in
results/
*
.tsv
do
./conv_sql
$FILE
done
# Load SQL files with benchmark results:
echo
echo
"Loading benchmark result data. This may take a while ..."
for
FILE
in
results/
*
.sql
for
FILE
in
results/
*
.sql
do
do
psql
-f
$FILE
|
grep
-v
"INSERT 0 1"
psql
-f
$FILE
|
grep
-v
"INSERT 0 1"
done
done
echo
"Done."
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment