Skip to content

SQL parser does not support schema-qualified table names #57

@fupelaqu

Description

@fupelaqu

Description

When using Apache Superset connected via Arrow Flight SQL, previewing a table triggers a query with a schema-qualified table name:

SELECT * FROM "default".ecommerce

The SQL parser cannot parse this syntax. Elasticsearch does not have a concept of schemas, but external tools (Superset, DBeaver, etc.) commonly prefix table names with a quoted schema (typically "default" or "information_schema").

Expected Behavior

The parser should accept schema-qualified identifiers in the form "schema".table (quoted schema only). For Elasticsearch, the schema component should be ignored and only the table name should be used.

Important: Only quoted schema prefixes are recognized. Unquoted dots are preserved as part of the Elasticsearch index name (e.g. logs-2025.03 remains logs-2025.03).

Reproduction

  1. Start the demo with docker compose --profile superset-flight up
  2. Open Superset at http://localhost:8088
  3. Navigate to SQL Lab or preview a table in the default schema
  4. Superset sends: SELECT * FROM "default".ecommerce
  5. The Flight SQL server returns a parse error

Suggested Approach

  • Add a quotedSchemaPrefix parser combinator in FromParser.scala that optionally matches a double-quoted string followed by . before the table name
  • The quoted schema is discarded and only the table name is passed to the Table AST node

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions