Skip to content

Backtick 'value' keyword in from_json struct type definitions#249

Merged
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/backtick-value-in-struct-type
Apr 3, 2026
Merged

Backtick 'value' keyword in from_json struct type definitions#249
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/backtick-value-in-struct-type

Conversation

@tkaunlaky-e6
Copy link
Copy Markdown

Summary

  • In from_json(), the schema string 'struct<value: string>' needs value backticked as `value` since it's a reserved keyword in the E6 engine's struct type parser
  • Handles it at the AST level in the e6 generator's anonymous_sql — when the function is from_json, checks each Literal argument for value: and replaces with `value`:
  • Does not affect valueKey, valueOf, etc. since replace("value:", ...) only matches the exact substring

Test plan

  • All 47 e6 tests pass (856 subtests)
  • struct<value: string, valueKey: string>struct<value: string, valueKey: string>

In from_json, if the schema Literal contains 'value:' as a field name,
backtick it to '`value`:' since value is a reserved keyword in the
E6 engine's struct type parser. Does not affect valueKey, valueOf, etc.
Copy link
Copy Markdown
Collaborator

@gauravdawar-e6 gauravdawar-e6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@gauravdawar-e6 gauravdawar-e6 merged commit a7b0006 into e6data:main Apr 3, 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