Skip to content

Commit cce0b1d

Browse files
committed
Support querying partitioned dataset
1 parent e33ea90 commit cce0b1d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

queries/common_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
def get_table_path(table_name: str) -> Path:
2424
"""Return the path to the given table."""
2525
ext = settings.run.io_type if settings.run.include_io else "parquet"
26-
return settings.dataset_base_dir / f"{table_name}.{ext}"
26+
if settings.num_batches is None:
27+
return settings.dataset_base_dir / f"{table_name}.{ext}"
28+
return settings.dataset_base_dir / str(settings.num_batches) / table_name / "*" / f"part.{ext}"
2729

2830

2931
def log_query_timing(

settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class Plot(BaseSettings):
7777

7878
class Settings(BaseSettings):
7979
scale_factor: float = 1.0
80+
num_batches: int | None = 1
8081

8182
paths: Paths = Paths()
8283
plot: Plot = Plot()

0 commit comments

Comments
 (0)