question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Superset SQL Lab time field display problem

See original GitHub issue

The statement to build a table is:

CREATE TABLE test.dwd_mid_app_ctr_readtime_info_local ( … … … rectime DateTime, createTime DateTime DEFAULT now() ) ENGINE = ReplicatedMergeTree(‘/clickhouse/tables/shard01/table_dwd_mid_app_ctr_readtime_info_local’, ‘table_dwd_mid_app_ctr_readtime_info_local_r1’) PARTITION BY (toYYYYMMDD(rectime), toHour(rectime)) ORDER BY (dev, rectime) SETTINGS index_granularity = 8192;

Use the client to query clickhouse, the result is: image

Use superset SQL Lab to query clickhouse, the result is:

image

I personally understand that this is due to the time zone issue that causes the time field to be formatted as utc? I tried to modify config.py and change.

image

But it still didn’t work. Please remind me how I should modify the time zone setting of superset to make the time consistent with the clickhouse server.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
boomballacommented, Jun 4, 2021

Regarding the inaccuracy of the time and time zone displayed by Superset, please refer to the description of @zhaoyongjie for the description of the problem: related discussion at clickhouse: https://github.com/ClickHouse/ClickHouse/issues/4548

Finally, the time display problem is solved by adjusting the time offset in the dataset. This problem still needs to be solved, otherwise the icon display time will be incorrect, which is a wrong time.

image

image

Hope it could help everyone,GL .

0reactions
boomballacommented, Jun 4, 2021

supplement: When I use superset sql lab to execute SQL, the following error is reported:

2021-06-03T11:58:36.273503888Z - File “/home/appops/python37_evn/lib/python3.7/site-packages/superset/result_set.py”, line 144, in init 2021-06-03T11:58:36.273506512Z - series, type=pa.timestamp(“ns”, tz=tz) 2021-06-03T11:58:36.273509037Z - File “pyarrow/array.pxi”, line 859, in pyarrow.lib.Array.from_pandas 2021-06-03T11:58:36.273511719Z - File “pyarrow/array.pxi”, line 265, in pyarrow.lib.array 2021-06-03T11:58:36.27351437Z - File “pyarrow/array.pxi”, line 80, in pyarrow.lib._ndarray_to_array 2021-06-03T11:58:36.273516996Z - File “pyarrow/error.pxi”, line 107, in pyarrow.lib.check_status 2021-06-03T11:58:36.27351961Z - pyarrow.lib.ArrowTypeError: Did not pass numpy.dtype object 2021-06-03T11:58:36.313761232Z - INFO:werkzeug:10.189.123.212 - - [03/Jun/2021 19:58:36] “�[37mPOST /superset/sql_json/ HTTP/1.1�[0m” 200 -

In my environment:

(python37_evn) appops@clickhouse-docker-newsrec-superset-3-9psnn-0924x-5fcd5d8784rjcb:~$ pip list|grep numpy numpy 1.20.3

You can try to downgrade numpy to 1.19.5,If the error is reported, it will work normally.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Asked Questions - Apache Superset
For running long query from Sql Lab, by default Superset allows it run as long as 6 hours before it being killed by...
Read more >
superset sql lab preview table returns state fail error 22
Hello HC, I have successfully created an external hive table from a druid datasource. CREATE EXTERNAL TABLE - 237584.
Read more >
airbnb/superset - Gitter
hi, I'm have a really weird issue on superset. I'm running 0.34.0rc1, I have 2 filterbox slices and both are present on the...
Read more >
Installation & Configuration - apache-superset - Read the Docs
SQL Lab is a powerful SQL IDE that works with all SQLAlchemy compatible databases. By default, queries are executed in the scope of...
Read more >
How to increase superset row limit and timeout cache for SQL ...
Therefore, if I change/increase the row limit in SQL lab and timeout cache in visualization, then I guess, there will be no problem....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found