Skip to content

Commit 943c4c3

Browse files
authored
Chore: move public BI benchmark script to scripts (#4897)
Since `public_bi` becomes a git repository, that script remains in there, always untracked. Adjusts the script to initialize the repository in a sibling directory to the directory of the script. ~~I don't actually know if we need to gitignore this but I don't think it will hurt.~~ Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
1 parent 8648af8 commit 943c4c3

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ profile.json.gz
212212
*.trace.json
213213
*.folded
214214

215-
216215
# LLVM profiles
217216
*.profraw
218217

bench-vortex/.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
data
2-
public_bi/.git
3-
public_bi/benchmark
1+
data/
2+
public_bi/

bench-vortex/public_bi/fetch_schemas_and_queries.sh renamed to bench-vortex/scripts/fetch_public_bi_schemas_and_queries.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ set -Eeuox pipefail
88
# https://stackoverflow.com/questions/59895/how-do-i-get-the-directory-where-a-bash-script-is-located-from-within-the-script
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010

11-
cd "${SCRIPT_DIR}"
11+
# Set up the public_bi directory relative to the script directory.
12+
PUBLIC_BI_DIR="${SCRIPT_DIR}/../public_bi"
13+
mkdir -p "${PUBLIC_BI_DIR}"
14+
cd "${PUBLIC_BI_DIR}"
1215

1316
if [ -d ".git" ]; then
1417
git reset --hard # restore deleted files if any

bench-vortex/src/public_bi.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ pub enum PBIDataset {
9898
}
9999

100100
pub fn fetch_schemas_and_queries() -> anyhow::Result<PathBuf> {
101-
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("public_bi");
101+
let scripts_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("scripts");
102102
let output = Command::new(
103-
base_dir
104-
.join("fetch_schemas_and_queries.sh")
103+
scripts_dir
104+
.join("fetch_public_bi_schemas_and_queries.sh")
105105
.to_str()
106106
.unwrap(),
107107
)
@@ -112,7 +112,9 @@ pub fn fetch_schemas_and_queries() -> anyhow::Result<PathBuf> {
112112
let stderr = String::from_utf8_lossy(&output.stderr);
113113
bail!("public_bi fetch failed: stdout=\"{stdout}\", stderr=\"{stderr}\"");
114114
}
115-
Ok(base_dir)
115+
116+
// Return the public_bi directory where the git repo is initialized.
117+
Ok(Path::new(env!("CARGO_MANIFEST_DIR")).join("public_bi"))
116118
}
117119

118120
#[derive(Debug)]

0 commit comments

Comments
 (0)