Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,23 +507,35 @@ The runner applies two ClickBench-specific setup steps automatically:
runner enables the parquet `binary_as_string` option so those columns
are read as strings.

If you set up ClickBench manually through SQL, use the same `EventDate`
view pattern:
If you set up ClickBench manually through SQL, register the single-file
dataset as follows:

```sql
CREATE EXTERNAL TABLE hits_raw
STORED AS PARQUET
LOCATION 'benchmarks/data/hits.parquet';
```

For the partitioned dataset, register the directory and enable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this locally and it works great

DataFusion CLI v54.0.0
> CREATE EXTERNAL TABLE hits_raw
STORED AS PARQUET
LOCATION 'benchmarks/data/hits_partitioned'
OPTIONS ('binary_as_string' 'true');
0 row(s) fetched.
Elapsed 0.060 seconds.

> CREATE VIEW hits AS
SELECT * EXCEPT ("EventDate"),
       CAST(CAST("EventDate" AS INTEGER) AS DATE) AS "EventDate"
FROM hits_raw;
0 row(s) fetched.
Elapsed 0.010 seconds.

> SELECT COUNT(*) FROM hits WHERE "AdvEngineID" <> 0;

+----------+
| count(*) |
+----------+
| 630500   |
+----------+
1 row(s) fetched.
Elapsed 0.030 seconds.

`binary_as_string`:

```sql
CREATE EXTERNAL TABLE hits_raw
STORED AS PARQUET
LOCATION 'benchmarks/data/hits_partitioned'
OPTIONS ('binary_as_string' 'true');
```

After registering either dataset as `hits_raw`, create the `hits` view with
the required `EventDate` conversion:

```sql
CREATE VIEW hits AS
SELECT * EXCEPT ("EventDate"),
CAST(CAST("EventDate" AS INTEGER) AS DATE) AS "EventDate"
FROM hits_raw;
```

For the partitioned dataset, use `benchmarks/data/hits_partitioned` and
add `OPTIONS ('binary_as_string' 'true')` to the external table statement.

From the repository root, download data and run the default ClickBench
queries against the single parquet file:

Expand Down
Loading