Skip to content

Visibility PR: changes compared to formatted original repo #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: original
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
database/*
*/*.pyc
tmp
!database/readme.txt
!tmp/readme.txt
66 changes: 66 additions & 0 deletions alter_michigan_databases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#~/usr/bin/env bash
set -e

DATABASE_DIR=.

copy_databases () {
db=$1
# Copy to *_test directory
altered=$DATABASE_DIR/${db}_test
cp -r "$DATABASE_DIR/$db" "$altered"

# Rename .sqlite files
cd "$altered"
for f in ${db}*.sqlite
do
mv "$f" "${db}_test${f#${db}}"
done
cd -
}

alter_yelp () {
for f in `ls $DATABASE_DIR/yelp_test/*.sqlite`
do
echo "ALTER TABLE neighbourhood RENAME TO neighborhood" | sqlite3 "$f"
echo "ALTER TABLE neighborhood RENAME COLUMN neighbourhood_name TO neighborhood_name" | sqlite3 "$f"
done
}

alter_imdb () {
for f in `ls $DATABASE_DIR/imdb_test/*.sqlite`
do
echo "ALTER TABLE cast RENAME TO cast2" | sqlite3 "$f"
done
}

alter_academic () {
:
}

alter_geo () {
:
}

alter_scholar () {
:
}

# geo is an exception in that we want to change the name from "geography" to "geo_test"
# it is easiest to achieve this is by copying "geography" to "geo" first
if [ ! -d $DATABASE_DIR/geo ]
then
cp -r $DATABASE_DIR/geography $DATABASE_DIR/geo
mv $DATABASE_DIR/geo/geography.sqlite $DATABASE_DIR/geo/geo.sqlite
fi

for DB in imdb yelp academic geo scholar
do
echo $DB
if [ ! -d "$DATABASE_DIR/${DB}_test" ]
then
copy_databases $DB
alter_"$DB"
else
echo "$DATABASE_DIR/${DB}_test already exists"
fi
done
2 changes: 1 addition & 1 deletion evaluate_classical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import List, Dict, Any, Tuple
import pickle as pkl
import tqdm
from exec_eval import exec_on_db, result_eq
from .exec_eval import exec_on_db, result_eq
import os
from collections import defaultdict
import time
Expand Down
Loading