dosubot[bot] commented on issue #37515:
URL: https://github.com/apache/superset/issues/37515#issuecomment-3809757286

   <!-- Greeting -->
   Hi @mosescha1972! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping 
the superset team.
   
   <!-- Answer -->
   This Oracle error is caused by Superset generating queries with positional 
GROUP BY (like GROUP BY 1,2,3), which Oracle does not support—Oracle requires 
explicit column names in GROUP BY clauses. This happens when Superset (via 
SQLGlot) rewrites queries for Oracle, especially when the "Formatted" option is 
enabled or when queries are wrapped as subqueries for filtering or ordering. 
Other databases are more permissive, so you only see this with Oracle.
   
   There is no built-in fix or recent code change in Superset master that 
addresses this. The most effective workaround is to upgrade the sqlglot 
dependency to at least version 27.21.0 (ideally 27.29.0 or newer), which 
improves GROUP BY handling for Oracle. You can do this by adding 
`sqlglot==27.29.0` to your `requirements-local.txt` and reinstalling 
dependencies. Alternatively, you can disable the "Formatted" option in SQL Lab 
or chart queries to prevent Superset from rewriting queries with positional 
GROUP BY. A permanent fix would require an upstream or codebase change; 
currently, there is no OracleEngineSpec override for this in Superset. 
   
   References:  
   - [Discussion on Oracle GROUP BY errors and 
workarounds](https://github.com/apache/superset/discussions/37431)  
   - [Issue with positional GROUP BY in 
Oracle](https://github.com/apache/superset/issues/35414)  
   - [Related technical 
details](https://github.com/apache/superset/issues/37044)
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/d4a6e0f7-98e8-4d5c-ace5-66d618084e36?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20Oracle%20error%20is%20caused%20by%20Superset%20generating%20queries%20with%20positional%20GROUP%20BY%20%28like%20GROUP%20BY%201%2C2%2C3%29%2C%20which%20Oracle%20does%20not%20support%E2%80%94Oracle%20requires%20explicit%20column%20names%20in%20GROUP%20BY%20clauses.%20This%20happens%20when%20Superset%20%28via%20SQLGlot%29%20rewrites%20queries%20for%20Oracle%2C%20especially%20when%20the%20%22Formatted%22%20option%20is%20enabled%20or%20when%20queries%20are%20wrapped%20as%20subqueries%20for%20filtering%20or%20ordering.%20Other%20databases%20are%20more%20permissive%2C%20so%20you%20only%20see%20this%20with%20Oracle.%0A%0AThere%20is%20no%20built-in%20fix%20or%20recent%20code%20change%20in%20Superset%20master%20that%20addresses%20this.%20The%20most%2
 
0effective%20workaround%20is%20to%20upgrade%20the%20sqlglot%20dependency%20to%20at%20least%20version%2027.21.0%20%28ideally%2027.29.0%20or%20newer%29%2C%20which%20improves%20GROUP%20BY%20handling%20for%20Oracle.%20You%20can%20do%20this%20by%20adding%20%60sqlglot%3D%3D27.29.0%60%20to%20your%20%60requirements-local.txt%60%20and%20reinstalling%20dependencies.%20Alternatively%2C%20you%20can%20disable%20the%20%22Formatted%22%20option%20in%20SQL%20Lab%20or%20chart%20queries%20to%20prevent%20Superset%20from%20rewriting%20queries%20with%20positional%20GROUP%20BY.%20A%20permanent%20fix%20would%20require%20an%20upstream%20or%20codebase%20change%3B%20currently%2C%20there%20is%20no%20OracleEngineSpec%20override%20for%20this%20in%20Superset.%20%0A%0AReferences%3A%20%20%0A-%20%5BDiscussion%20on%20Oracle%20GROUP%20BY%20errors%20and%20workarounds%5D%28https%3A//github.com/apache/superset/discussions/37431%29%20%20%0A-%20%5BIssue%20with%20positional%20GROUP%20BY%20in%20Oracle%5D%28https%3A//github.c
 
om/apache/superset/issues/35414%29%20%20%0A-%20%5BRelated%20technical%20details%5D%28https%3A//github.com/apache/superset/issues/37044%29)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37515)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to