Skip to content

SQL parser: support backtick-qualified catalog names natively #85

@fupelaqu

Description

@fupelaqu

Summary

The SQL parser (Parser) does not support backtick-qualified catalog names (e.g., `prod_us`.orders). The federation QueryPlanner currently works around this by stripping catalog prefixes via regex before parsing, then tracking the catalog→table mapping separately.

This works but is fragile:

  • Regex must skip single-quoted string literals to avoid corrupting WHERE values
  • Catalog extraction and stripping happen outside the parser, duplicating concerns

Proposed Enhancement

Add native catalog support to the parser so that Table.name or a new Table.catalog field captures the catalog prefix directly from the AST. This would allow the planner to read catalogs from the parsed AST instead of regex pre-processing.

Context

  • Federation module in softclient4es-arrow is the consumer
  • Current workaround: QueryPlanner.extractCatalogList() + stripAllCatalogPrefixes() with string-literal skipping
  • Related: Story 3.1 (Query Planner & Sub-Query Generation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions