From 2c3c5474735a4064bfd54ad05159fb00f54b86f3 Mon Sep 17 00:00:00 2001 From: suyashkhare1403 Date: Wed, 4 Mar 2026 14:00:32 +0530 Subject: [PATCH] Disable Star EXCEPT column_sql override in E6 dialect Comment out column_sql method that stripped table identifiers from Star EXCEPT clauses and its corresponding test. --- sqlglot/dialects/e6.py | 34 +++++++++++++++++----------------- tests/dialects/test_e6.py | 12 ++++++------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sqlglot/dialects/e6.py b/sqlglot/dialects/e6.py index 039c21f30c..315cb9c6c2 100644 --- a/sqlglot/dialects/e6.py +++ b/sqlglot/dialects/e6.py @@ -2509,23 +2509,23 @@ def not_sql(self, expression: exp.Not) -> str: else: return super().not_sql(expression) - def column_sql(self, expression: exp.Column) -> str: - """ - Override to skip table identifier when Star has an EXCEPT clause. - - For E6 dialect, `table.* EXCEPT(col)` should become `* EXCEPT(col)` - without the table prefix. - """ - this = expression.args.get("this") - - # Check if this column is inside a Star's except clause - skip table identifier - parent = expression.parent - if isinstance(parent, exp.Star) and parent.args.get("except"): - # Return only the column name without table prefix - return self.sql(this) - - # Default behavior for all other cases - return super().column_sql(expression) + # def column_sql(self, expression: exp.Column) -> str: + # """ + # Override to skip table identifier when Star has an EXCEPT clause. + # + # For E6 dialect, `table.* EXCEPT(col)` should become `* EXCEPT(col)` + # without the table prefix. + # """ + # this = expression.args.get("this") + # + # # Check if this column is inside a Star's except clause - skip table identifier + # parent = expression.parent + # if isinstance(parent, exp.Star) and parent.args.get("except"): + # # Return only the column name without table prefix + # return self.sql(this) + # + # # Default behavior for all other cases + # return super().column_sql(expression) def median_sql(self, expression: exp.Median): if not self.SUPPORTS_MEDIAN: diff --git a/tests/dialects/test_e6.py b/tests/dialects/test_e6.py index ce7b41b873..26c3a28072 100644 --- a/tests/dialects/test_e6.py +++ b/tests/dialects/test_e6.py @@ -54,12 +54,12 @@ def test_E6(self): }, ) - self.validate_all( - "SELECT r.* EXCEPT (_____dp_update_ts) FROM gold.ops.slp_fcc_gains_and_reasons AS r", - read={ - "databricks": "select r.* except (r._____dp_update_ts) from gold.ops.slp_fcc_gains_and_reasons as r" - }, - ) + # self.validate_all( + # "SELECT r.* EXCEPT (_____dp_update_ts) FROM gold.ops.slp_fcc_gains_and_reasons AS r", + # read={ + # "databricks": "select r.* except (r._____dp_update_ts) from gold.ops.slp_fcc_gains_and_reasons as r" + # }, + # ) self.validate_all( "SELECT REDUCE(ARRAY[1, 2, 3], 0, (acc, x) -> acc + x)",