From 3d6e48862be331799e38a7119de8737f5c876b49 Mon Sep 17 00:00:00 2001 From: nicor88 <6278547+nicor88@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:41:08 +0100 Subject: [PATCH] fix: use string when text is passed (#498) Co-authored-by: Jeremy Guiselin --- dbt/adapters/athena/column.py | 6 ++++++ dbt/adapters/athena/impl.py | 1 + 2 files changed, 7 insertions(+) diff --git a/dbt/adapters/athena/column.py b/dbt/adapters/athena/column.py index fa153858..46448cae 100644 --- a/dbt/adapters/athena/column.py +++ b/dbt/adapters/athena/column.py @@ -1,4 +1,5 @@ from dataclasses import dataclass +from typing import ClassVar, Dict from dbt.adapters.athena.relation import TableType from dbt.adapters.base.column import Column @@ -9,6 +10,11 @@ class AthenaColumn(Column): table_type: TableType = TableType.TABLE + TYPE_LABELS: ClassVar[Dict[str, str]] = { + "STRING": "VARCHAR", + "TEXT": "VARCHAR", + } + def is_iceberg(self) -> bool: return self.table_type == TableType.ICEBERG diff --git a/dbt/adapters/athena/impl.py b/dbt/adapters/athena/impl.py index 390ca111..a74326a1 100755 --- a/dbt/adapters/athena/impl.py +++ b/dbt/adapters/athena/impl.py @@ -122,6 +122,7 @@ class AthenaAdapter(SQLAdapter): ConnectionManager = AthenaConnectionManager Relation = AthenaRelation AdapterSpecificConfigs = AthenaConfig + Column = AthenaColumn # There is no such concept as constraints in Athena CONSTRAINT_SUPPORT = {