Skip to content

SAP HANA calculation view call with PLACEHOLDER parameters is re-cased by Superset 6.0.0 and causes "invalid table name" (HANA error 259) #39328

Closed

Description

@ku7mich

Bug description

Environment:

  • Superset 6.0.0 (worked in 5.0.0)
  • Python 3.11.14
  • SQLAlchemy: 1.4.54
  • sqlalchemy-hana: 2.8.0

Steps to reproduce:

  1. Open SQL Lab and select SAP HANA connection.
  2. Run the following SQL:
    SELECT * FROM _sys_bic."zbw.10_001/INVENTORY" ( 'PLACEHOLDER' = ('$$IP_DATE_TO$$', ''), 'PLACEHOLDER' = ('$$IP_DATE_FROM$$', '') )

Superset returns error:
SAP HANA Error hana error: (259, 'invalid table name: Could not find table/view ZBW.10_001/INVENTORY in schema _SYS_BIC: line 6 col 17 (at pos 49)')

If run the same SQL query without PLACEHOLDER, it's OK:
SELECT * FROM _sys_bic."zbw.10_001/INVENTORY"

If run the same SQL query without PLACEHOLDER, but with "ZBW" in uppercase the error is repeated (even in Superset 5.0.0):
SELECT * FROM _sys_bic."ZBW.10_001/INVENTORY"

Screenshots/recordings

No response

Superset version

6.0.0

Python version

3.11

Node version

I don't know

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.

Activity

  1. added
    #bug:regressionBugs that are identified as regessions
    sqllabNamespace | Anything related to the SQL Lab
    on Apr 13, 2026
  2. dosubot commented on Apr 13, 2026

    @dosubot

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

    This is caused by Superset 6.0.0 always parsing and regenerating SQL queries through sqlglot before execution [1]. SAP HANA is mapped to the PostgreSQL dialect in sqlglot [2], and when sqlglot regenerates your SQL, it uppercases the quoted identifier "zbw.10_001/INVENTORY" → "ZBW.10_001/INVENTORY", which breaks the case-sensitive HANA lookup.

    Between Superset 5.0.0 and 6.0.0, sqlglot was upgraded from v27 to v28, which likely changed how the PostgreSQL dialect handles quoted identifiers with special characters like . and /. This is part of a broader pattern — several databases (PostgreSQL, SQL Server, Oracle, ClickHouse) have reported sqlglot regeneration corrupting queries in 6.0.0.

    Workaround options:

    1. Create a HANA view that wraps the calculation view with PLACEHOLDERs, and query that view from Superset instead.
    2. Downgrade to Superset 5.0.0 if this is a blocker.

    For a proper fix, this likely needs either:

    • A custom sqlglot dialect for SAP HANA (similar to what was done for Pinot) that preserves identifier casing correctly.
    • Or a change to the HANA dialect mapping in superset/sql/parse.py to use a dialect that doesn't uppercase quoted identifiers.
    • Or reporting the specific identifier uppercasing behavior to the sqlglot project as a bug.

    You can verify this is the root cause by checking what SQL Superset actually sends to HANA — look at the executed_sql field in the query history, or test parsing/regenerating your query directly with sqlglot v28 using the PostgreSQL dialect.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about superset Share Dosu with your team

  3. self-assigned this
    on Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

#bug:regressionBugs that are identified as regessionsdata:connect:hanaRelated to HanasqllabNamespace | Anything related to the SQL Lab

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions