Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Conversation

@pekapa
Copy link

@pekapa pekapa commented Sep 24, 2023

Problem

Starting on version 1.3 DBT Python models became available. Another very common programming language for submitting spark jobs is Scala. This PR enables Scala models to be built with DBT

Solution

Using the structure created by Python models we can extend it to also support Scala models.
The parser for Scala is not widely available so a "cheap" version was built to provide just the minimum needed for it. More complex solutions (using ANTLR, for example) might be desired in the future.
Since the Python validator is missing tests we are also skipping those for now here. Same for typed annotations, it follows the precedent set by the Python models code.

Related dbt-core PR: dbt-labs/dbt-core/pull/8701

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

FishtownBuildBot and others added 14 commits April 13, 2023 18:37
…on on refresh (dbt-labs#724) (dbt-labs#727)

* update `drop_relation()` to drop `target_relation` instead of `old_relation`; these should be the same anyway, but `old_relation` doesn't always get populated

* add in old relation type in cases where the relation type changes

(cherry picked from commit 44b10f9)

Co-authored-by: Mike Alfare <[email protected]>
* CT-2223: Add CONSTRAINT_SUPPORT mapping to adapter implementation

* CT-2223: Model constraints implemented for spark

* CT-2223: Add unit test

* CT-2223: Exclude test not applicable to spark

* CT-2223: Another unit test fix.

* CT-2223: Final (?) unit test fix

* CT-2223: Final (??) unit test fix

* Update .changes/unreleased/Features-20230427-123135.yaml

Co-authored-by: Doug Beatty <[email protected]>

---------

Co-authored-by: Doug Beatty <[email protected]>
(cherry picked from commit 4f1039d)

Co-authored-by: Peter Webb <[email protected]>
# Conflicts:
#	.bumpversion.cfg
#	CHANGELOG.md
#	dbt/adapters/spark/__version__.py
#	dbt/adapters/spark/impl.py
#	setup.py
#	tests/functional/adapter/test_constraints.py
@pekapa pekapa requested a review from a team as a code owner September 24, 2023 16:41
@cla-bot cla-bot bot added the cla:yes label Sep 24, 2023
@pekapa pekapa changed the title bumping .latest branch variable in update_dependencies.sh to 1.5.latest Submit scala jobs beta Sep 24, 2023
@github-actions
Copy link
Contributor

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Mar 23, 2024
@github-actions
Copy link
Contributor

Although we are closing this PR as stale, it can still be reopened to continue development. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants