Bug description

Steps to Reproduce

  1. Create database connection to Oracle 19.24 using cx_Oracle.
  2. Create a bar chart visualization.
  3. Get Chart Error "Data error"
  4. Open View query.When "Formatted" = False → SQL query is valid. When "Formatted" = True → SQL query becomes invalid, Superset generates GROUP BY 1,2,3 which is not supported by Oracle.

Superset shows invalid query with positional grouping (GROUP BY 1,2,3) which fails in Oracle.

In Oracle, positional GROUP BY (GROUP BY 1,2,3) is not supported. Query should instead use explicit column names.

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] 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.

Comment From: dosubot[bot]

Hi @n3v3rdie! I'm Dosu and I’m helping the superset team.

Oracle does not support positional references like GROUP BY 1,2,3; it requires explicit column names in the GROUP BY clause. Superset's current SQL formatting logic does not account for this Oracle limitation, so when "Formatted" is set to True, it generates queries with positional grouping, which leads to the ORA-00979 error you observed. This behavior is due to the lack of Oracle-specific handling in the relevant query generation code—specifically, there is no logic in the Oracle engine spec or the core query builder to force explicit column names for Oracle databases. No recent changes or configuration options address this, so a code update would be needed to fix the formatting for Oracle connections. For now, keeping "Formatted" set to False is the only workaround to avoid this error in Oracle reference.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: n3v3rdie

@dosu yes, but the graph is also displayed with an error.

Comment From: dosubot[bot]

The graph shows an error because Superset relies on successful query execution to render visualizations. When the query fails—like with Oracle's ORA-00979 error due to unsupported positional GROUP BY—the backend catches the error and sends it to the frontend, which displays an error banner in the chart area. There isn't any Oracle-specific fallback or partial rendering; all database errors are handled generically, and failed queries always result in a visualization error message. The only workaround is to use "Formatted" = False so the query remains valid for Oracle and the chart can render as expected. More details on error handling are in the code reference and error message guidelines.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X