-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Open
Labels
data:connect:druidRelated to DruidRelated to Druid
Description
Bug description
With the update to Superset 6.0.0, ARRAY expressions on Apache Druid are falsely mutated.
Any query with an array expression (i.e. ARRAY[1, 2, 3]) is mutated to a wrong form ARRAY(1, 2, 3), causing the following exception in Druid:
class org.apache.calcite.sql.fun.SqlArrayValueConstructor cannot be cast to class org.apache.calcite.sql.SqlFunction (org.apache.calcite.sql.fun.SqlArrayValueConstructor
I have created a fix in sqlglot at tobymao/sqlglot#6664
For other readers: the issue can be monkey-patched, i.e. in superset_config.py:
# monkey patch Druid Dialect (see https://github.com/apache/superset/issues/36926 / https://github.com/tobymao/sqlglot/pull/6664)
from sqlglot import exp
from sqlglot.dialects.druid import Druid
Druid.Generator.TRANSFORMS[exp.Array] = lambda self, e: f"ARRAY[{self.expressions(e)}]"Screenshots/recordings
No response
Superset version
6.0.0 (Docker)
Python version
Whatever the 6.0.0 Docker Image uses
Node version
Whatever the 6.0.0 Docker Image uses
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Metadata
Metadata
Assignees
Labels
data:connect:druidRelated to DruidRelated to Druid