datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Update ClickBench runner scripts to treat EventDate as a Date (not Int16)

Open alamb opened this issue 10 months ago • 5 comments

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

alamb avatar Jan 25 '26 13:01 alamb

FYI @waynexia as this may be related to your work

  • #19826

alamb avatar Jan 25 '26 13:01 alamb

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 avatar Feb 21 '26 18:02 KARTIK64-rgb

@KARTIK64-rgb

Assigned. Thanks for voluntering to work on this.

kosiew avatar Feb 24 '26 06:02 kosiew

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.

KARTIK64-rgb avatar Feb 24 '26 12:02 KARTIK64-rgb

https://github.com/ClickHouse/ClickBench/pull/803 has been merged, so closing thos one. Thanks again @KARTIK64-rgb

alamb avatar Mar 26 '26 11:03 alamb