dosubot[bot] commented on issue #36776:
URL: https://github.com/apache/superset/issues/36776#issuecomment-3677733452

   <!-- Answer -->
   This is a known bug in Superset 6.0.0: when you drill to detail by a 
datetime column with a time grain in Table charts, Superset generates a SQL 
filter that matches only the exact datetime value (like 
`'2025-12-20T00:00:00.000Z'`). ClickHouse is strict about datetime formats and 
this causes a type mismatch error because it expects a proper DateTime, not an 
ISO string with a 'Z' suffix. The expected behavior is to filter by a time 
range that covers the entire day, not just the exact timestamp.
   
   This was fixed in a later release ([PR 
#36318](https://github.com/apache/superset/pull/36318)), where drill-to-detail 
now uses a Time Range filter instead of an equality filter, so all records 
within the selected day are included. If you can upgrade to a version with this 
fix, that will resolve the issue.
   
   If upgrading isn't possible, workarounds include: using a virtual dataset 
with custom SQL to handle the time grain logic, or manually adjusting your 
dataset to cast or format the datetime values in a way that matches 
ClickHouse's expectations. You can also try overriding the default daily time 
grain expression for ClickHouse to use `toDate({col})` instead of 
`toStartOfDay(toDateTime({col}))` if your data and use case allow it, but this 
may require changes in your Superset configuration or dataset definition. More 
details and discussion are available in [issue 
#23847](https://github.com/apache/superset/issues/23847) and [related 
threads](https://github.com/apache/superset/issues/28014).
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/65ef0255-2278-42c1-892d-64766ee3c013?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20bug%20in%20Superset%206.0.0%3A%20when%20you%20drill%20to%20detail%20by%20a%20datetime%20column%20with%20a%20time%20grain%20in%20Table%20charts%2C%20Superset%20generates%20a%20SQL%20filter%20that%20matches%20only%20the%20exact%20datetime%20value%20%28like%20%60%272025-12-20T00%3A00%3A00.000Z%27%60%29.%20ClickHouse%20is%20strict%20about%20datetime%20formats%20and%20this%20causes%20a%20type%20mismatch%20error%20because%20it%20expects%20a%20proper%20DateTime%2C%20not%20an%20ISO%20string%20with%20a%20%27Z%27%20suffix.%20The%20expected%20behavior%20is%20to%20filter%20by%20a%20time%20range%20that%20covers%20the%20entire%20day%2C%20not%20just%20the%20exact%20timestamp.%0A%0AThis%20was%20fixed%20in%20a%20later%20release%20%28%5BPR%20
 
%2336318%5D%28https%3A//github.com/apache/superset/pull/36318%29%29%2C%20where%20drill-to-detail%20now%20uses%20a%20Time%20Range%20filter%20instead%20of%20an%20equality%20filter%2C%20so%20all%20records%20within%20the%20selected%20day%20are%20included.%20If%20you%20can%20upgrade%20to%20a%20version%20with%20this%20fix%2C%20that%20will%20resolve%20the%20issue.%0A%0AIf%20upgrading%20isn%27t%20possible%2C%20workarounds%20include%3A%20using%20a%20virtual%20dataset%20with%20custom%20SQL%20to%20handle%20the%20time%20grain%20logic%2C%20or%20manually%20adjusting%20your%20dataset%20to%20cast%20or%20format%20the%20datetime%20values%20in%20a%20way%20that%20matches%20ClickHouse%27s%20expectations.%20You%20can%20also%20try%20overriding%20the%20default%20daily%20time%20grain%20expression%20for%20ClickHouse%20to%20use%20%60toDate%28%7Bcol%7D%29%60%20instead%20of%20%60toStartOfDay%28toDateTime%28%7Bcol%7D%29%29%60%20if%20your%20data%20and%20use%20case%20allow%20it%2C%20but%20this%20may%20require%20ch
 
anges%20in%20your%20Superset%20configuration%20or%20dataset%20definition.%20More%20details%20and%20discussion%20are%20available%20in%20%5Bissue%20%2323847%5D%28https%3A//github.com/apache/superset/issues/23847%29%20and%20%5Brelated%20threads%5D%28https%3A//github.com/apache/superset/issues/28014%29.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36776)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to