Fix DataFusion EventDate handling: cast UInt16 to DATE#803
Open
KARTIK64-rgb wants to merge 2 commits intoClickHouse:mainfrom
Open
Fix DataFusion EventDate handling: cast UInt16 to DATE#803KARTIK64-rgb wants to merge 2 commits intoClickHouse:mainfrom
KARTIK64-rgb wants to merge 2 commits intoClickHouse:mainfrom
Conversation
cb33c5f to
f5fa7cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClickBench encodes
EventDateas aUInt16representing days since1970-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 castEventDatefromUInt16to a proper SQLDATE: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
hitsview apache/datafusion#19881