diff --git a/dbt/adapters/spark/column.py b/dbt/adapters/spark/column.py index 4df6b301b..b5a6f58f4 100644 --- a/dbt/adapters/spark/column.py +++ b/dbt/adapters/spark/column.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from typing import Any, Dict, Optional, TypeVar, Union +from typing import Any, ClassVar, Dict, Optional, TypeVar, Union from dbt.adapters.base.column import Column from dbt.dataclass_schema import dbtClassMixin @@ -18,9 +18,13 @@ class SparkColumn(dbtClassMixin, Column): table_stats: Optional[Dict[str, Any]] = None column_index: Optional[int] = None + TYPE_LABELS: ClassVar[Dict[str, str]] = { + "LONG": "BIGINT", + } + @classmethod def translate_type(cls, dtype: str) -> str: - return dtype + return super().translate_type(dtype).lower() def can_expand_to(self: Self, other_column: Self) -> bool: """returns True if both columns are strings""" @@ -35,10 +39,10 @@ def quoted(self) -> str: @property def data_type(self) -> str: - return self.dtype + return self.translate_type(self.dtype) def __repr__(self) -> str: - return "".format(self.name, self.data_type) + return "".format(self.name, self.translate_type(self.data_type)) @staticmethod def convert_table_stats(raw_stats: Optional[str]) -> Dict[str, Any]: