Skip to content

Commit

Permalink
test(duckdb): load parquet files instead of generating tpch data ever…
Browse files Browse the repository at this point in the history
…y time (#9308)
  • Loading branch information
cpcloud authored Jun 4, 2024
1 parent 3d0f9bc commit 62e48f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ibis/backends/duckdb/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ def connect(*, tmpdir, worker_id, **kw) -> BaseBackend:
return ibis.duckdb.connect(**kw)

def load_tpch(self) -> None:
"""Load the TPC-H dataset."""
with self.connection._safe_raw_sql("CALL dbgen(sf=0.17)"):
pass
"""Load TPC-H data."""
con = self.connection
for path in self.data_dir.joinpath("tpch", "sf=0.17", "parquet").glob(
"*.parquet"
):
table_name = path.with_suffix("").name
# duckdb automatically infers the sf=0.17 as a hive partition
con.read_parquet(path, table_name=table_name, hive_partitioning=False)


@pytest.fixture(scope="session")
Expand Down

0 comments on commit 62e48f5

Please sign in to comment.