summaryrefslogtreecommitdiffstats
path: root/sqlglot/dataframe/sql/column.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/dataframe/sql/column.py')
-rw-r--r--sqlglot/dataframe/sql/column.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/sqlglot/dataframe/sql/column.py b/sqlglot/dataframe/sql/column.py
index 40ffe3e..f5b0974 100644
--- a/sqlglot/dataframe/sql/column.py
+++ b/sqlglot/dataframe/sql/column.py
@@ -260,11 +260,7 @@ class Column:
"""
if isinstance(dataType, DataType):
dataType = dataType.simpleString()
- new_expression = exp.Cast(
- this=self.column_expression,
- to=sqlglot.parse_one(dataType, into=exp.DataType, read="spark"), # type: ignore
- )
- return Column(new_expression)
+ return Column(exp.cast(self.column_expression, dataType, dialect="spark"))
def startswith(self, value: t.Union[str, Column]) -> Column:
value = self._lit(value) if not isinstance(value, Column) else value