summaryrefslogtreecommitdiffstats
path: root/sqlglot/dataframe/sql/column.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-22 18:53:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-22 18:53:31 +0000
commit20d090151fbc2e75394fc456f49f0078e59752d8 (patch)
tree084494962f092ff80f5ef8fdba1b917206abbc83 /sqlglot/dataframe/sql/column.py
parentAdding upstream version 16.2.1. (diff)
downloadsqlglot-dc21fa7b0e4a7e2cdab572cd150636d3304b0f4f.tar.xz
sqlglot-dc21fa7b0e4a7e2cdab572cd150636d3304b0f4f.zip
Adding upstream version 16.4.0.upstream/16.4.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dataframe/sql/column.py')
-rw-r--r--sqlglot/dataframe/sql/column.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sqlglot/dataframe/sql/column.py b/sqlglot/dataframe/sql/column.py
index a8b89d1..f4cfeba 100644
--- a/sqlglot/dataframe/sql/column.py
+++ b/sqlglot/dataframe/sql/column.py
@@ -5,6 +5,7 @@ import typing as t
import sqlglot
from sqlglot import expressions as exp
from sqlglot.dataframe.sql.types import DataType
+from sqlglot.dialects import Spark
from sqlglot.helper import flatten, is_iterable
if t.TYPE_CHECKING:
@@ -22,6 +23,10 @@ class Column:
expression = sqlglot.maybe_parse(expression, dialect="spark")
if expression is None:
raise ValueError(f"Could not parse {expression}")
+
+ if isinstance(expression, exp.Column):
+ expression.transform(Spark.normalize_identifier, copy=False)
+
self.expression: exp.Expression = expression
def __repr__(self):