Skip to content

Commit

Permalink
Add setting for running Polars without optimizations (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Apr 12, 2024
1 parent 7b40c5a commit 76aedef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions queries/polars/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ def get_part_supp_ds() -> pl.LazyFrame:

def run_query(query_number: int, lf: pl.LazyFrame) -> None:
streaming = settings.run.polars_streaming
eager = settings.run.polars_eager

if settings.run.polars_show_plan:
print(lf.explain(streaming=streaming))
print(lf.explain(streaming=streaming, optimized=eager))

query = partial(lf.collect, streaming=streaming)
query = partial(lf.collect, streaming=streaming, no_optimization=eager)
run_query_generic(
query, query_number, "polars", query_checker=check_query_result_pl
)
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Run(BaseSettings):
check_results: bool = False # Only available for SCALE_FACTOR=1

polars_show_plan: bool = False
polars_eager: bool = False
polars_streaming: bool = False
polars_streaming_groupby: bool = False

Expand Down

0 comments on commit 76aedef

Please sign in to comment.