You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "maratbakiev2 (via GitHub)" <gi...@apache.org> on 2023/04/30 04:41:36 UTC

[GitHub] [superset] maratbakiev2 opened a new issue, #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

maratbakiev2 opened a new issue, #23883:
URL: https://github.com/apache/superset/issues/23883

   When I'm trying to use time range filter on chart built on top of datasource from ClickHouse that has DateTime('UTC') as a time column it fails.
   
   #### How to reproduce the bug
    
   1. Create clickhouse table with DateTime('UTC') column and make a dataset in Superset from it. Create any chart and put it on the dashboard
   2. Create time range filter and apply it
   5. See error
   
   ### Expected results
   
   I've expected the values to be correctly filtered
   
   ### Actual results
   
   After applying the filter all the charts that have this column as time column disappear and the error is shown
   
   #### Screenshots
   
   <img width="1128" alt="image" src="https://user-images.githubusercontent.com/37618176/235335610-9f9e3cd3-b2d9-4128-b3d7-ecbc4d218d41.png">
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version: Chrome Version 112.0.5615.137 (Official Build) (arm64)
   - superset version: `2.0.1`
   - python version: `3.8.12`
   - node.js version: `not relevant`
   - any feature flags active: no
   
   ### Checklist
   
   Completed
   
   ### Additional context
   
   superset logs for the error
   
   2023-04-28 08:57:53,906:ERROR:clickhouse_connect.driver.httpclient:Code: 53. DB::Exception: Cannot convert string 2023-04-21 00:00:00.000000 to type DateTime('UTC'): while executing 'FUNCTION greaterOrEquals(fact_new_at : 1, '2023-04-21 00:00:00.000000' : 2) -> greaterOrEquals(fact_new_at, '2023-04-21 00:00:00.000000') UInt8 : 4'. (TYPE_MISMATCH) (version 22.3.19.6 (official build))
   
   Query SELECT toStartOfDay(toDateTime(fact_new_at)) AS __timestamp,
   count(order_id) AS COUNT(order_id)
   FROM marts.fact_orders
   WHERE fact_new_at >= '2023-04-21 00:00:00.000000'
   AND fact_new_at < '2023-04-28 00:00:00.000000'
   GROUP BY toStartOfDay(toDateTime(fact_new_at))
   ORDER BY COUNT(order_id) DESC
   LIMIT 10000 on schema marts failed
   Traceback (most recent call last):
   File "/app/superset/connectors/sqla/models.py", line 1920, in query
   df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
   File "/app/superset/models/core.py", line 458, in get_df
   self.db_engine_spec.execute(cursor, sqls[-1])
   File "/app/superset/db_engine_specs/base.py", line 1261, in execute
   raise cls.get_dbapi_mapped_exception(ex)
   File "/app/superset/db_engine_specs/base.py", line 1259, in execute
   cursor.execute(query)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/dbapi/cursor.py", line 50, in execute
   query_result = self.client.query(operation, parameters)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/client.py", line 178, in query
   return self._query_with_context(query_context)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 207, in _query_with_context
   response = self._raw_request(body,
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 387, in _raw_request
   self._error_handler(response)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 323, in _error_handler
   raise OperationalError(err_str) if retried else DatabaseError(err_str) from None
   clickhouse_connect.driver.exceptions.DatabaseError: :HTTPDriver for http://chi-simple-nonreplicated-0-0.stable.svc.cluster.local:8123/ returned response code 400)
   Code: 53. DB::Exception: Cannot convert string 2023-04-21 00:00:00.000000 to type DateTime('UTC'): while executing 'FUNCTION greaterOrEquals(fact_new_at : 1, '2023-04-21 00:00:00.000000' : 2) -> greaterOrEquals(fact_new_at, '2023-04-21 00:0
   2023-04-28 08:57:53,907:WARNING:superset.connectors.sqla.models:Query SELECT toStartOfDay(toDateTime(fact_new_at)) AS __timestamp,
   count(order_id) AS COUNT(order_id)
   FROM marts.fact_orders
   WHERE fact_new_at >= '2023-04-21 00:00:00.000000'
   AND fact_new_at < '2023-04-28 00:00:00.000000'
   GROUP BY toStartOfDay(toDateTime(fact_new_at))
   ORDER BY COUNT(order_id) DESC
   LIMIT 10000 on schema marts failed
   Traceback (most recent call last):
   File "/app/superset/connectors/sqla/models.py", line 1920, in query
   df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
   File "/app/superset/models/core.py", line 458, in get_df
   self.db_engine_spec.execute(cursor, sqls[-1])
   File "/app/superset/db_engine_specs/base.py", line 1261, in execute
   raise cls.get_dbapi_mapped_exception(ex)
   File "/app/superset/db_engine_specs/base.py", line 1259, in execute
   cursor.execute(query)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/dbapi/cursor.py", line 50, in execute
   query_result = self.client.query(operation, parameters)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/client.py", line 178, in query
   return self._query_with_context(query_context)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 207, in _query_with_context
   response = self._raw_request(body,
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 387, in _raw_request
   self._error_handler(response)
   File "/usr/local/lib/python3.8/site-packages/clickhouse_connect/driver/httpclient.py", line 323, in _error_handler
   raise OperationalError(err_str) if retried else DatabaseError(err_str) from None
   clickhouse_connect.driver.exceptions.DatabaseError: :HTTPDriver for http://chi-simple-nonreplicated-0-0.stable.svc.cluster.local:8123/ returned response code 400)
   Code: 53. DB::Exception: Cannot convert string 2023-04-21 00:00:00.000000 to type DateTime('UTC'): while executing 'FUNCTION greaterOrEquals(fact_new_at : 1, '2023-04-21 00:00:00.000000' : 2) -> greaterOrEquals(fact_new_at, '2023-04-21 00:0
   


-- 
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: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] maratbakiev2 commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "maratbakiev2 (via GitHub)" <gi...@apache.org>.
maratbakiev2 commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1536279688

   @EugeneTorap I'll try to do it in the nearest future and come back here


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sfirke closed issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke closed issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column
URL: https://github.com/apache/superset/issues/23883


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] EugeneTorap commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "EugeneTorap (via GitHub)" <gi...@apache.org>.
EugeneTorap commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1534109987

   Hi @maratbakiev2! Can you test the issue in 2.1.0 version of superset?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sfirke commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1682927684

   Let's close this as @maratbakiev2 can't reproduce on 2.1.0 (thanks for reporting back!)  If anyone else disagrees / can reproduce it on a current version, please say so.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] maratbakiev2 commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "maratbakiev2 (via GitHub)" <gi...@apache.org>.
maratbakiev2 commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1528937676

   See also my discussion of this behavior in clickhouse-connect repo https://github.com/ClickHouse/clickhouse-connect/issues/177


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] maratbakiev2 commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "maratbakiev2 (via GitHub)" <gi...@apache.org>.
maratbakiev2 commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1677985464

   @EugeneTorap sorry for the delay. I've tested it in 2.1.0. No errors :)
   So it could be closed. At least from my point of view.


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] EugeneTorap commented on issue #23883: Time range filter on Clickhouse datasource with DateTime(timezone) column

Posted by "EugeneTorap (via GitHub)" <gi...@apache.org>.
EugeneTorap commented on issue #23883:
URL: https://github.com/apache/superset/issues/23883#issuecomment-1625783396

   Hi @villebro @sebastianliebscher! Do you know who to fix it?


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org