-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use show table extended with table name list for get_catalog. (#237)
### Description Uses `show table extended` with table name list for `get_catalog`. - Running `describe table extended` for all tables could be slower than `show table extended` with table name list. - Statistics that will appear in the generated docs are not included in `describe table extended`.
- Loading branch information
Showing
5 changed files
with
385 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
from dataclasses import dataclass | ||
from typing import ClassVar, Dict | ||
|
||
from dbt.adapters.spark.column import SparkColumn | ||
|
||
|
||
@dataclass | ||
class DatabricksColumn(SparkColumn): | ||
TYPE_LABELS: ClassVar[Dict[str, str]] = { | ||
"LONG": "BIGINT", | ||
} | ||
|
||
@classmethod | ||
def translate_type(cls, dtype: str) -> str: | ||
return super(SparkColumn, cls).translate_type(dtype).lower() | ||
|
||
@property | ||
def data_type(self) -> str: | ||
return self.translate_type(self.dtype) | ||
|
||
def __repr__(self) -> str: | ||
return "<DatabricksColumn {} ({})>".format(self.name, self.data_type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.