Incubator-superset: ERROR:superset.sql_lab:Query 14: <class 'UnicodeDecodeError'>

Created on 24 Nov 2020  ยท  8Comments  ยท  Source: apache/incubator-superset

A clear and concise description of what the bug is.

Expected results

show content correctly in preview tab under SQL lab

Actual results

clickhouse error: 'utf-8' codec can't decode byte 0xcc in position 69: invalid continuation byte

Screenshots

If applicable, add screenshots to help explain your problem.

How to reproduce the bug

  1. add a SQLAlchemy URI of clickhouse in databases list with format mentioned in document 'clickhouse://default@XXXXXXXX:8124/tutorial'
    2.choose a table with utf-8 character
  2. Preview tab show error 'clickhouse error: 'utf-8' codec can't decode byte 0xcc in position 69: invalid continuation byte'

Environment

(please complete the following information):
deploy with docker

  • superset version: 0.37.2
  • python version: 3.7.9
  • node.js version: v4.2.6

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

Log in container

Triggering query_id: 17
INFO:superset.views.core:Triggering query_id: 17
timeout can't be used in the current context
WARNING:superset.utils.core:timeout can't be used in the current context
signal only works in main thread
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/superset/utils/core.py", line 624, in __enter__
signal.signal(signal.SIGALRM, self.handle_timeout)
File "/usr/local/lib/python3.6/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
ERROR:superset.utils.core:signal only works in main thread
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/superset/utils/core.py", line 624, in __enter__
signal.signal(signal.SIGALRM, self.handle_timeout)
File "/usr/local/lib/python3.6/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread
SQLite Database support for metadata databases will be removed in a future version of Superset.
WARNING:superset.sql_lab:SQLite Database support for metadata databases will be removed in a future version of Superset.
Query 17: Executing 1 statement(s)
INFO:superset.sql_lab:Query 17: Executing 1 statement(s)
Query 17: Set query to 'running'
INFO:superset.sql_lab:Query 17: Set query to 'running'
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.47:8124
DEBUG:urllib3.connectionpool:http://192.168.100.47:8124 "POST /?user=default HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.47:8124
DEBUG:urllib3.connectionpool:http://192.168.100.47:8124 "POST /?database=tutorial&user=default HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.47:8124
DEBUG:urllib3.connectionpool:http://192.168.100.47:8124 "POST /?database=tutorial&user=default HTTP/1.1" 200 None
Query 17: Running statement 1 out of 1
INFO:superset.sql_lab:Query 17: Running statement 1 out of 1
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.100.47:8124
DEBUG:urllib3.connectionpool:http://192.168.100.47:8124 "POST /?query_id=47f0c45e-2e2a-11eb-a7a5-0242ac110002&database=tutorial&user=default HTTP/1.1" 200 None
Query 17:
ERROR:superset.sql_lab:Query 17:

#bug

All 8 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.81. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Which clickhouse dialect do you use

On Tue, Nov 24, 2020 at 3:54 PM issue-label-bot[bot] <
[email protected]> wrote:

Issue-Label Bot is automatically applying the label #bug to this issue,
with a confidence of 0.81. Please mark this comment with ๐Ÿ‘ or ๐Ÿ‘Ž to give
our bot feedback!

Links: app homepage https://github.com/marketplace/issue-label-bot,
dashboard https://mlbot.net/data/apache/incubator-superset and code
https://github.com/hamelsmu/MLapp for this bot.

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/apache/incubator-superset/issues/11796#issuecomment-732721884,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAPMKUTYLYXG27GBFUJUDNTSRNRDZANCNFSM4UAQSFEA
.

Which clickhouse dialect do you use
โ€ฆ
On Tue, Nov 24, 2020 at 3:54 PM issue-label-bot[bot] < @.*> wrote: Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.81. Please mark this comment with ๐Ÿ‘ or ๐Ÿ‘Ž to give our bot feedback! Links: app homepage https://github.com/marketplace/issue-label-bot, dashboard https://mlbot.net/data/apache/incubator-superset and code https://github.com/hamelsmu/MLapp for this bot. โ€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#11796 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPMKUTYLYXG27GBFUJUDNTSRNRDZANCNFSM4UAQSFEA .

sqlalchemy-clickhouse

@yahwang try setting engine_params to UTF-8

DATA -> DATABASES -> select clickhouse instance. editing Extra

{
    "metadata_params": {},
    "engine_params": {"encoding": "UTF-8"},
    "metadata_cache_timeout": {},
    "schemas_allowed_for_csv_upload": []
}

@yahwang try setting engine_params to UTF-8

DATA -> DATABASES -> select clickhouse instance. editing Extra

{
    "metadata_params": {},
    "engine_params": {"encoding": "UTF-8"},
    "metadata_cache_timeout": {},
    "schemas_allowed_for_csv_upload": []
}

not work, nothing changed

Try to use this script in the same environment to check whether if you can display UTF-8 table name

from sqlalchemy import create_engine, inspect

engine = create_engine("clickhouse://<DBURI>")
inspector = inspect(engine)
inspector.get_table_names()

Try to use this script in the same environment to check whether if you can display UTF-8 table name

from sqlalchemy import create_engine, inspect

engine = create_engine("clickhouse://<DBURI>")
inspector = inspect(engine)
inspector.get_table_names()

from sqlalchemy import create_engine, inspect
engine = create_engine("clickhouse://[email protected]:8124/tutorial")
inspector = inspect(engine)
inspector.get_table_names()
['hits_v1', 'hits_v1_nre', 'visits_v1']

@yahwang

which table contains UTF-8 column? fetch the columns by the SQLAlchemy inspector. Is it raise an exception?

inspector.get_columns('<TABLE NAME>')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shyam2794 picture shyam2794  ยท  3Comments

tmccartan picture tmccartan  ยท  3Comments

amien90 picture amien90  ยท  3Comments

john-bodley picture john-bodley  ยท  3Comments

kalimuthu123 picture kalimuthu123  ยท  3Comments