Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always set database = schema #91

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dbt/adapters/spark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def list_relations_without_caching(
_schema, name, _, information = row
rel_type = ('view' if 'Type: VIEW' in information else 'table')
relation = self.Relation.create(
database=_schema,
schema=_schema,
identifier=name,
type=rel_type
Expand Down
9 changes: 1 addition & 8 deletions dbt/adapters/spark/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ class SparkRelation(BaseRelation):
def __post_init__(self):
# some core things set database='', which we should ignore.
if self.database and self.database != self.schema:
raise RuntimeException(
f'Error while parsing relation {self.name}: \n'
f' identifier: {self.identifier} \n'
f' schema: {self.schema} \n'
f' database: {self.database} \n'
f'On Spark, database should not be set. Use the schema '
f'config to set a custom schema/database for this relation.'
)
self.__dict__['path'] = self.path.incorporate(database = self.schema)

def render(self):
if self.include_policy.database and self.include_policy.schema:
Expand Down