-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Superset using duckdb connection encounter DB engine error #31978
Comments
Hey there, @ivanonair! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's tackle this issue together! The issue you're encountering with DuckDB in Superset might be related to how concurrent queries are handled. DuckDB does not support running multiple queries concurrently on the same connection, which could lead to the errors you're seeing when multiple filters are applied on a dashboard. This is consistent with the error message about "No open result set" and the potential connection termination. To address this, you might consider the following approaches:
These steps might help mitigate the issue by ensuring that queries are handled in a way that aligns with DuckDB's capabilities. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Ping @guenp as I know you're involved with DuckDB |
@guenp @ivanonair I created a POC using duckdb and apache superset on my local machine in the 2nd half of november. I had multiple filters and multiple KPIs. I was able to run and demo it smoothly. I revisited the same thing 4-5 days back and suddenly it has started to break and I keep encountering the same error.
I am on superset 4.1.1 with PG 15 and redis 7 on local windows machine. I am curious to know if there is a workaround for the same? It used to work fine but there is some change which is causing this functionality to break. |
We've recently started experiencing Gunicorn worker crashes when loading dashboards with charts that serve data via DuckDB. This issue began in the past couple of weeks, coinciding with updates to The crash seems to stem from the following code, specifically the self.reserved_words.update(
{
keyword_name
for (keyword_name,) in duckdb.execute(
"select keyword_name from duckdb_keywords() where keyword_category == 'reserved'"
).fetchall()
}
) Although I’m not highly proficient in Python, I suspect the issue is related to concurrency and the direct use of |
@johna-xceleration the suggestion worked very well for me. I downgraded duckdb-engine to 0.14.1 and the issue got resolved. Thank you for the help, appreciate it. |
Bug description
When I use DuckDB to connect to MINIO to read data, I often encounter (not always) the following error:
or sometime error msg are
This seems to be related to having multiple filters on a dashboard. I observed that to generate the dropdown menu for each filter, a distinct SQL query is executed on the dataset for each filter. I suspect that this is causing many concurrent queries to be executed simultaneously when the dashboard is opened.
And there is also an error msg on superset server:
The current probability of error occurrence is about fifty-fifty without changing any settings, not occur every time.
This leads to suspicions that it might be an issue with the rate limit or the number of threads. In the article below, I saw that when using duckdb.connect(:default:), it might induce error since running queries concurrently on the same connection is not supported.
duckdb issue link
However, this is different from the error message I received, and I'm not sure if it's related. Has anyone else using Superset + DuckDB encountered a similar issue? Thanks."
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.10
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: