Skip to content

fix(e6): quote reserved-word keys in Databricks colon path access - #286

Merged
tkaunlaky-e6 merged 1 commit into
e6data:mainfrom
tkaunlaky-e6:fix/e6-colon-reserved-keyword-quoting
Jul 30, 2026
Merged

fix(e6): quote reserved-word keys in Databricks colon path access#286
tkaunlaky-e6 merged 1 commit into
e6data:mainfrom
tkaunlaky-e6:fix/e6-colon-reserved-keyword-quoting

Conversation

@tkaunlaky-e6

Copy link
Copy Markdown

Problem

Databricks colon path access on a reserved-word key — e.g. Properties:limit — fails to transpile to valid E6. E6's colon-path grammar accepts only a non-reserved identifier after :, so a bare reserved word makes the E6/Calcite parser throw Encountered ":". The e6 generator only quoted RESERVED_DATATYPE_KEYWORDS (25 datatype names), leaving the other E6 reserved words (LIMIT, FROM, ORDER, …) bare.

This is the "Parse: Databricks colon accessor" failure bucket — 90 queries in the TomTom migration run, all Properties:limit.

Fix

Widen the colon-key quoting check in _render_variant_colon and json_extract_sql (databricks branch) from RESERVED_DATATYPE_KEYWORDS to also cover the full RESERVED_KEYWORDS set, emitting col:"limit". Non-reserved keys are unchanged (stay bare); datatype keys keep working.

Validation

  • Verified against the live E6/Calcite engine: col:"limit" parses natively (0 transpiler fallbacks) while bare col:limit throws Encountered ":".
  • SELECT Properties:limitSELECT Properties:"limit"; the 13 non-reserved keys in the real query (country, area, custom_metrics_name, …) stay bare.
  • Added test cases; full test_e6.py suite passes (59 tests / 896 subtests).

Example

-- Databricks
SELECT Properties:limit FROM t
-- e6 (before) -> SELECT Properties:limit    (rejected: Encountered ":")
-- e6 (after)  -> SELECT Properties:"limit"  (accepted natively)

E6's colon-path grammar accepts only a non-reserved identifier after ':',
so a bare reserved word such as `col:limit` fails to parse ("Encountered
':'"). The e6 generator only quoted RESERVED_DATATYPE_KEYWORDS (25 datatype
names), leaving the other E6 reserved words (LIMIT, FROM, ORDER, ...) bare.

Widen the colon-key quoting check in _render_variant_colon and
json_extract_sql to the full RESERVED_KEYWORDS set, emitting col:"limit".
Non-reserved keys are unchanged (stay bare); datatype keys keep working.

Validated against the live E6/Calcite engine: col:"limit" parses natively
while col:limit does not. Fixes the "Parse: Databricks colon accessor"
failure bucket (all observed cases are Properties:limit).
@tkaunlaky-e6
tkaunlaky-e6 merged commit 0c54db5 into e6data:main Jul 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants