-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
SupersetErrorType.ADHOC_SUBQUERY_NOT_ALLOWED_ERROR thrown for valid quoted column name #30977
Comments
Hi @cezudas! I'm here to help you with any bugs, questions, or contributions you have for the project. Let's tackle this issue together! The issue you're encountering seems to be related to how the In your case, it appears that the parser might be misinterpreting the quoted column names containing the word "on" as sub-queries or table references. This could be due to the way the SQL parsing logic handles certain keywords or patterns within column names. To address this issue, you might want to check if the FEATURE_FLAGS = {
"ALLOW_ADHOC_SUBQUERY": True,
} Or set the environment variable: export SUPERSET_FEATURE_ALLOW_ADHOC_SUBQUERY=True If the issue persists even with the feature flag enabled, it might require further investigation into the SQL parsing logic to ensure that quoted column names are correctly handled without being misinterpreted as sub-queries. |
I appreciate your support +1
I would appreciate if the maintainers would take this bug report under consideration, and maybe we will get a proper fix one day. |
@dosu
|
I have the same issue in TABLE chart in RAW RECORDS query mode for columns with a dot in their names - this showed up after upgrading from 4.0.2 to 4.1.1. Enabling |
Bug description
I set up a bar chart
X axis
value to a column named 'Created on'.When the chart data loads I get an error: "Custom SQL fields cannot contain sub-queries."
Sample chart SQL query:
SELECT DATE_TRUNC('day', "Created on") AS "Created on", sum("Estimated savings / Month") AS "SUM(Estimated savings / Month)" FROM public."Opportunities_4_userfriendly" WHERE ("Status" NOT IN ('Dismissed', 'Completed')) GROUP BY DATE_TRUNC('day', "Created on") LIMIT 50000;
In my case, choosing any other column containing the token 'on' for the
X axis
, such as "Update on" will lead to the same error.My guess is the bug originates from
superset/models/helpers.py#validate_adhoc_subquery
. The parser is likely incorrectly interpreting "Created on" as a table reference because of the word "on"Screenshots/recordings
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: