Skip to content

Commit d3e0a6f

Browse files
author
Jesse Whitehouse
committed
(2/x) Enable behaviour from #326 behind an environment variable
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
1 parent c77ca36 commit d3e0a6f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

dbt/adapters/databricks/impl.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from contextlib import contextmanager
33
from itertools import chain
44
from dataclasses import dataclass
5+
import os
56
import re
67
from typing import (
78
Any,
@@ -448,12 +449,17 @@ def _get_one_catalog(
448449
table_names.add(relation.identifier)
449450

450451
columns: List[Dict[str, Any]] = []
451-
identifier = "|".join(table_names)
452+
453+
_identifier = "|".join(table_names)
454+
bypass_2048_char_limit = os.environ.get("DBT_DESCRIBE_TABLE_2048_CHAR_BYPASS", "false")
455+
if bypass_2048_char_limit == "true":
456+
_identifier = _identifier if len(_identifier) < 2048 else "*"
457+
452458
if len(table_names) > 0:
453459
schema_relation = self.Relation.create(
454460
database=database,
455461
schema=schema,
456-
identifier=identifier,
462+
identifier=_identifier,
457463
quote_policy=self.config.quoting,
458464
)
459465
for relation, information in self._list_relations_with_information(schema_relation):

0 commit comments

Comments
 (0)