-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
35 lines (29 loc) · 1.29 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Default command to show available commands
default:
@echo "just what?"
@echo "----------"
@just --list
# Set default values
default_aws_profile := "grid2-prod"
# Query a file (auto-detect type based on extension)
query FILE_PATH PROFILE=default_aws_profile:
#!/usr/bin/env bash
set -euo pipefail
file_type=$(echo "{{FILE_PATH}}" | awk -F. '{print tolower($NF)}')
if [[ "$file_type" != "csv" && "$file_type" != "parquet" ]]; then
echo "Error: Unsupported file type. Use 'queryc' or 'queryp' for explicit CSV or Parquet querying."
exit 1
fi
python duckdb_query.py "{{FILE_PATH}}" --type $file_type --profile "{{PROFILE}}"
# Query a CSV file
queryc FILE_PATH PROFILE=default_aws_profile:
python duckdb_query.py} "{{FILE_PATH}}" --type csv --profile "{{PROFILE}}"
# Query a Parquet file
queryp FILE_PATH PROFILE=default_aws_profile:
python duckdb_query.py "{{FILE_PATH}}" --type parquet --profile "{{PROFILE}}"
# npq = native (duckdb cli) parquet query
npq FILE_PATH PROFILE=default_aws_profile:
python duckdb_query.py "{{FILE_PATH}}" --type parquet --profile "{{PROFILE}}" --ui cli
# hpq = harlequin parquet query
hpq FILE_PATH PROFILE=default_aws_profile:
python duckdb_query.py "{{FILE_PATH}}" --type parquet --profile "{{PROFILE}}" --ui harlequin