Skip to content

fix(e6): Tableau E'...' / newline flags also work under SUBQUERY_TREE(_MULTIDIALECT) - #339

Merged
tkaunlaky-e6 merged 1 commit into
mainfrom
fix/estring-gate-subtree
Nov 19, 2026
Merged

tkaunlaky-e6 merged 1 commit into
mainfrom
fix/estring-gate-subtree

Conversation

@tkaunlaky-e6

Copy link
Copy Markdown

Why

samsung-dashboard failed 708 runs (9 distinct Tableau queries) with Lexical error ... Encountered: "". Each query has a Tableau parameter bound as E'VZ_...,\nVZ_...'inside the Databricks "Custom SQL Query". TheE'...' handling (STRIP_E_STRING_PREFIX) and newline stripping (STRIP_STRING_NEWLINES) from #332 only took effect together with SAMSUNG_TABLEAU_DASHBOARD`. With the subquery tree, that flag isn't needed for routing, so without it the transpiler returned a 500 and the engine parsed the original query.

What

Each sub-flag now takes effect together with any one of SAMSUNG_TABLEAU_DASHBOARD, SUBQUERY_TREE or SUBQUERY_TREE_MULTIDIALECT. It is still gated: a sub-flag alone, or a mode flag alone, changes nothing.

Env E'...' read as a string Newlines stripped from strings
mode flag only no no
mode flag + STRIP_E_STRING_PREFIX yes no
mode flag + STRIP_E_STRING_PREFIX + STRIP_STRING_NEWLINES yes yes

"Mode flag" means SAMSUNG_TABLEAU_DASHBOARD, SUBQUERY_TREE or SUBQUERY_TREE_MULTIDIALECT.

Deployment for samsung-dashboard: SUBQUERY_TREE=true STRIP_E_STRING_PREFIX=true STRIP_STRING_NEWLINES=true. These are read at startup, so restart the pods after changing them.

Verified

  • The 9 failing prod queries with SUBQUERY_TREE + both sub-flags (no Samsung flag): 9/9 OK, and the output is identical to the old Samsung method. With SUBQUERY_TREE alone they still fail (0/9), as before.
  • Tests:
    • test_samsung_tableau_escape_strings and test_strip_string_newlines now check each of the three mode flags, and that each flag alone does nothing.
    • New test_tableau_escape_strings_without_samsung_flag runs end to end through /convert-query with the subtree.
    • These tests fail without the change.
  • make test and make test-rs: OK. make test-multidialect (Samsung / Condé Nast / OneTrust): OK.
  • ruff and ruff-format pass. The only mypy error is the missing generated sqlglot/_version.py, unrelated to this change.

…(_MULTIDIALECT)

STRIP_E_STRING_PREFIX and STRIP_STRING_NEWLINES were only active together with
SAMSUNG_TABLEAU_DASHBOARD. A deployment running the subquery tree without that flag
failed Samsung Tableau queries carrying E'...\n' parameters. Each sub-flag is now
active with SAMSUNG_TABLEAU_DASHBOARD, SUBQUERY_TREE or SUBQUERY_TREE_MULTIDIALECT;
on its own it still does nothing.
@tkaunlaky-e6
tkaunlaky-e6 merged commit 9de8fc7 into main Nov 19, 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