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)
Summary
The SQL parser (
Parser) does not support backtick-qualified catalog names (e.g.,`prod_us`.orders). The federationQueryPlannercurrently works around this by stripping catalog prefixes via regex before parsing, then tracking the catalog→table mapping separately.This works but is fragile:
Proposed Enhancement
Add native catalog support to the parser so that
Table.nameor a newTable.catalogfield 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
softclient4es-arrowis the consumerQueryPlanner.extractCatalogList()+stripAllCatalogPrefixes()with string-literal skipping