Skip to content

Unquote function names in e6 output and preserve schema qualifiers#250

Merged
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/unquote-function-names
Apr 13, 2026
Merged

Unquote function names in e6 output and preserve schema qualifiers#250
gauravdawar-e6 merged 1 commit intoe6data:mainfrom
tkaunlaky-e6:fix/unquote-function-names

Conversation

@tkaunlaky-e6
Copy link
Copy Markdown

@tkaunlaky-e6 tkaunlaky-e6 commented Apr 13, 2026

Summary

  • Backtick-quoted function names from Databricks (e.g. `schema`.`func`()) were either losing their schema/catalog qualifiers or retaining backticks in the e6 output.
  • e6 uses double quotes (") as identifier quotes, not backticks. This PR ensures that backtick-quoted identifiers from Databricks are correctly converted to double-quoted identifiers in e6, and function names themselves are never quoted.
  • Qualified function calls now preserve the schema/catalog parts:
    • `schema`.`getdek`()"schema".getdek()
    • `catalog`.`schema`.`getdek`()"catalog"."schema".getdek()

Changes

  • sqlglot/dialects/e6.py: Removed hardcoded GETDEK exp.Dot transform. Rewrote anonymous_sql to use expression.name (unquoted) and skip normalization for qualified functions so case is preserved.
  • tests/dialects/test_e6.py: Updated test expectation to match the new correct output.

Test plan

  • test_transpile.py verified both schema.func() and catalog.schema.func() cases
  • Full test suite (make test) — 2 previously failing GETDEK tests now updated

cc @gauravdawar-e6

Backtick-quoted function names from Databricks (e.g. `schema`.`func`()) are
now transpiled with the schema/catalog preserved and the function name unquoted,
since e6 uses double quotes (") as identifiers, not backticks.
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 6403fb5 into e6data:main Apr 13, 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