Update ClickBench runner scripts to treat EventDate as a Date (not Int16)
Describe the bug
- Part of https://github.com/apache/datafusion/issues/18982
@nuno-faria found that ClickBench is treating EventDate as a INT16 rather than Date, resulting in questionable (and likely slower) results
@kosiew fixed the scripts in the DataFusion repository in
- https://github.com/apache/datafusion/pull/19881
However, we now need to make the same change to the ClickBench runner scripts in https://github.com/ClickHouse/ClickBench/tree/main/datafusion
See https://github.com/apache/datafusion/pull/19881#discussion_r2725543167 fore more details
To Reproduce
No response
Expected behavior
ClickBench runner scripts should also convert EventDate to a Date rather than String
Additional context
No response
FYI @waynexia as this may be related to your work
- #19826
Hi! I’d love to be assigned to this issue. I’ve reviewed the changes in #19881 and also looked at the relevant scripts in the ClickHouse/ClickBench/tree/main/datafusion directory. Based on that, here’s how I’m planning to approach the fix: Proposed approach: create.sql: Update the table definition so that EventDate is properly registered or cast as a DATE type, instead of being treated as Int16 or UInt16. run.sh / benchmark.sh: After loading the parquet file as hits_raw, create a hits view that converts the raw UInt16 value (days since epoch) into a proper SQL DATE using: CAST(CAST("EventDate" AS INTEGER) AS DATE) This follows the same pattern used in #19881.
queries.sql: Verify that queries 36–42, which rely on EventDate range filters, work correctly with the updated DATE type.
This approach mirrors the fix in #19881 and should resolve the issue where ClickBench queries 36–42 return 0 rows due to incorrect date comparisons.
I’d be happy to work on this — please assign it to me!
@KARTIK64-rgb
Assigned. Thanks for voluntering to work on this.
Hi @kosiew , I've raised a PR on ClickHouse/ClickBench to apply the same fix: https://github.com/ClickHouse/ClickBench/pull/803
This mirrors the approach from #19881 — casting EventDate from UInt16
to a proper SQL DATE in the runner scripts.
https://github.com/ClickHouse/ClickBench/pull/803 has been merged, so closing thos one. Thanks again @KARTIK64-rgb