Skip to content

Comments

Fix DataFusion EventDate handling: cast UInt16 to DATE#803

Open
KARTIK64-rgb wants to merge 2 commits intoClickHouse:mainfrom
KARTIK64-rgb:fix/eventdate-cast-to-date
Open

Fix DataFusion EventDate handling: cast UInt16 to DATE#803
KARTIK64-rgb wants to merge 2 commits intoClickHouse:mainfrom
KARTIK64-rgb:fix/eventdate-cast-to-date

Conversation

@KARTIK64-rgb
Copy link

Summary

ClickBench encodes EventDate as a UInt16 representing days since
1970-01-01. The DataFusion runner was treating it as a raw integer,
causing ClickBench queries 36–42 to return 0 rows due to broken date
range predicates.

Changes

  • Updated the DataFusion runner scripts under datafusion/ to cast
    EventDate from UInt16 to a proper SQL DATE:

    CAST(CAST("EventDate" AS INTEGER) AS DATE)

    Correctness fix — no meaningful performance impact.

  • Without this change, queries Q37-Q43 that filter on EventDate using date literals (e.g., >= '2013-07-01') return incorrect results (0 rows) because EventDate is stored as INT32 in the parquet file and DataFusion compares it against string literals. The new view casts EventDate to a proper DATE type

References

@CLAassistant
Copy link

CLAassistant commented Feb 24, 2026

CLA assistant check
All committers have signed the CLA.

@KARTIK64-rgb KARTIK64-rgb force-pushed the fix/eventdate-cast-to-date branch from cb33c5f to f5fa7cb Compare February 25, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants