Bug description

I am testing the 6.0.0rc1 eager to use spatial capabilites in duckdb with the openstreetmap chart titles. However after switching from 5.0.0 a INSTALL spatial command (or any other extension) fails with duckdb error: Parser Error: syntax error at or near "AS". From reading #34856 I wonder if the changes in Superset's SQL dialect handling are the root for this.

Screenshots/recordings

Image

Superset version

master / latest-dev

Python version

3.10

Node version

16

Browser

Firefox

Additional context

2025-09-02 10:14:18,338:WARNING:superset.views.error_handling:SupersetErrorsException
Traceback (most recent call last):
  File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/app/.venv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/app/.venv/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/views/base_api.py", line 120, in wraps
    duration, response = time_function(f, self, *args, **kwargs)
  File "/app/superset/utils/core.py", line 1409, in time_function
    response = func(*args, **kwargs)
  File "/app/superset/views/base_api.py", line 92, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/utils/log.py", line 304, in wrapper
    value = f(*args, **kwargs)
  File "/app/superset/sqllab/api.py", line 406, in execute_sql_query
    command_result: CommandResult = command.run()
  File "/app/superset/utils/decorators.py", line 267, in wrapped
    return on_error(ex)
  File "/app/superset/utils/decorators.py", line 232, in on_error
    raise ex
  File "/app/superset/utils/decorators.py", line 260, in wrapped
    result = func(*args, **kwargs)
  File "/app/superset/commands/sql_lab/execute.py", line 105, in run
    status = self._run_sql_json_exec_from_scratch()
  File "/app/superset/commands/sql_lab/execute.py", line 158, in _run_sql_json_exec_from_scratch
    return self._sql_json_executor.execute(
  File "/app/superset/sqllab/sql_json_executer.py", line 110, in execute
    raise SupersetErrorsException(
superset.exceptions.SupersetErrorsException: [SupersetError(message='duckdb error: Parser Error: syntax error at or near "AS"', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'DuckDB', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

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 @boun! I'm Dosu and I’m helping the superset team.

This issue is caused by changes in Superset 6.0.0rc1's SQL dialect handling, which introduced stricter parsing and validation. Superset does not have special handling for DuckDB's INSTALL commands, so these are treated as generic SQL. The new dialect logic likely misclassifies or alters the INSTALL spatial statement, resulting in the parser error you see. There is currently no documented workaround or solution for installing DuckDB extensions from within Superset 6.0.0rc1, and this problem is now tracked as GitHub issue #34984. For now, you may need to install DuckDB extensions outside of Superset before connecting, as Superset expects extension setup to be managed externally if needed.

To reply, just mention @dosu.


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