Skip to content

Preserve map[] bracket syntax in VALUES clause for E6#219

Merged
deepakdixit-e6x merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/preserve-map-bracket-in-values
Feb 26, 2026
Merged

Preserve map[] bracket syntax in VALUES clause for E6#219
deepakdixit-e6x merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/preserve-map-bracket-in-values

Conversation

@tkaunlaky-e6
Copy link

Summary

  • Fixed map['k1', 'v1', 'k2', 'v2'] inside INSERT INTO ... VALUES being incorrectly converted to ELEMENT_AT("map", 'k1'), dropping 3 of 4 expressions
  • Databricks uses MAP() with parens for map construction — map[...] with brackets in VALUES is column access that should be preserved as-is
  • The fix only applies when: column name is map, expressions > 1, and inside a VALUES clause

Test plan

  • Added test case: VALUES (map['k1', 'v1', 'k2', 'v2']) preserved in E6 output
  • Added test case: VALUES (map['k1', 'v1', 'k2', 'v2'], '123') with multiple columns
  • Added test case: SELECT map['key'] still converts to ELEMENT_AT
  • All 38 existing E6 tests pass (829 subtests)

When transpiling from Databricks to E6, map[...] with multiple
expressions inside a VALUES clause was incorrectly converted to
ELEMENT_AT(), dropping all but the first expression. Databricks
uses MAP() with parens for map construction, so map[...] in
INSERT VALUES is column access that should be preserved as-is.
@deepakdixit-e6x deepakdixit-e6x merged commit 24a31eb into e6data:main Feb 26, 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