GitHub user dosubot[bot] added a comment to the discussion: Superset is not
able to load the result from hydrolix
<!-- Answer -->
My recommended approach, in order of preference:
**1. Best long-term fix: Report this to Hydrolix as a bug**
Your queries clearly contain valid time range filters (`"timestamp" >=
toDateTime('...') AND "timestamp" < toDateTime('...')`). Hydrolix's validator
(v24.8.6.1) should recognize this format. The fact that it doesn't is a defect
in their time range parser. File a ticket with Hydrolix support showing that
their validator rejects `toDateTime('...')` comparisons — this is the correct
fix at the source.
**2. Best immediate fix: Override `convert_dttm()` to drop the `toDateTime()`
wrapper**
Create a custom engine spec that outputs bare datetime string literals, which
Hydrolix's validator is more likely to recognize:
```python
# In your superset_config.py or a custom engine spec module
from superset.db_engine_specs.clickhouse import ClickHouseConnectEngineSpec
from datetime import datetime
from typing import Optional
class HydrolixEngineSpec(ClickHouseConnectEngineSpec):
engine_name = "Hydrolix"
# Match your existing database connection engine
engine = "clickhousedb"
# Override to use bare string literals instead of toDateTime()
@classmethod
def convert_dttm(
cls, target_type: str, dttm: datetime, db_extra: Optional[dict] = None
) -> Optional[str]:
sqla_type = cls.get_sqla_column_type(target_type)
if isinstance(sqla_type, types.Date):
return f"'{dttm.strftime('%Y-%m-%d')}'"
if isinstance(sqla_type, (types.DateTime, types.TIMESTAMP)):
return f"'{dttm.strftime('%Y-%m-%d %H:%M:%S')}'"
return None
```
This makes Superset generate `"timestamp" >= '2026-06-23 14:02:34'` instead of
`"timestamp" >= toDateTime('2026-06-23 14:02:34')`. ClickHouse implicitly casts
string literals to DateTime in comparisons, so the query still works correctly
— and Hydrolix's validator should recognize it.
**3. Acceptable short-term workaround: Disable the check conditionally**
Modify your `SQL_QUERY_MUTATOR` to set `hdx_query_timerange_required = False`
only when a time filter is already present:
```python
def SQL_QUERY_MUTATOR(sql, **kwargs):
...
query = str(sql)
# Detect if query already has a time range filter
has_time_filter = bool(re.search(
r'["\']?timestamp["\']?\s*>=', query, re.IGNORECASE
))
query, query_settings = extract_settings(query)
# Override: don't require time range if one is already present
if has_time_filter:
query_settings.setdefault("hdx_query_timerange_required", False)
new_settings = get_settings(
user_name=user_name,
security_manager=security_manager,
query_settings=query_settings,
)
...
```
This keeps the safety guardrail for queries without time filters (like ad-hoc
SQL Lab queries) while bypassing the broken validator for chart/dashboard
queries that already include one.
***
**My recommendation**: Go with **option 3 as your immediate fix** (deploy
today, unblocks your dashboards) and **option 1 in parallel** (report to
Hydrolix so they fix their validator). Option 2 is the cleanest long-term
solution if Hydrolix won't fix the validator, but requires more testing to
ensure nothing else breaks.
<!-- Dosu Comment Footer -->
*To reply, just mention
[@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Share context across your team and agents. Try
[Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=6b26ef87-c594-4c34-944f-b1769cd02b8e)
[](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset)
[](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset)
GitHub link:
https://github.com/apache/superset/discussions/41395#discussioncomment-17425003
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]