Skip to content

Commit

Permalink
(2/x) Enable behaviour from #326 behind an environment variable
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
Jesse Whitehouse committed Aug 2, 2023
1 parent c77ca36 commit d3e0a6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dbt/adapters/databricks/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from contextlib import contextmanager
from itertools import chain
from dataclasses import dataclass
import os
import re
from typing import (
Any,
Expand Down Expand Up @@ -448,12 +449,17 @@ def _get_one_catalog(
table_names.add(relation.identifier)

columns: List[Dict[str, Any]] = []
identifier = "|".join(table_names)

_identifier = "|".join(table_names)
bypass_2048_char_limit = os.environ.get("DBT_DESCRIBE_TABLE_2048_CHAR_BYPASS", "false")
if bypass_2048_char_limit == "true":
_identifier = _identifier if len(_identifier) < 2048 else "*"

if len(table_names) > 0:
schema_relation = self.Relation.create(
database=database,
schema=schema,
identifier=identifier,
identifier=_identifier,
quote_policy=self.config.quoting,
)
for relation, information in self._list_relations_with_information(schema_relation):
Expand Down

0 comments on commit d3e0a6f

Please sign in to comment.