dbt-labs / dbt-spark

dbt-spark contains all of the code enabling dbt to work with Apache Spark and Databricks
https://getdbt.com
Apache License 2.0
395 stars 221 forks source link

Add support for Spark Connect (SQL models) #899

Open vakarisbk opened 12 months ago

vakarisbk commented 12 months ago

partially resolves #814 docs dbt-labs/docs.getdbt.com/#

Problem

dbt-spark has limited options for open-source Spark integrations. Currently, the only available method to run dbt with open-source Spark in production is through a Thrift connection. However, a Thrift connection isn't suitable for all use cases. For instance, it doesn't support thrift over HTTP. Also, the PyHive project, that dbt thrift relies on, is unsupported (at least according to their GitHub page).

Solution

Propose introducing support for Spark Connect (for SQL models only).

Checklist

How to test locally?

  1. Follow the instructions in the Spark documentation to download Spark distribution. https://spark.apache.org/docs/latest/spark-connect-overview.html
  2. Start spark connect server with Hive metastore enabled ./start-connect-server.sh --packages org.apache.spark:spark-connect_2.12:3.5.0 --conf spark.sql.catalogImplementation=hive
  3. Add the Spark Connect configuration to your profiles.yml:
    spark_connect:
    outputs:
    dev:
      host: localhost
      method: connect
      port: 15002
      schema: default
      type: spark
    target: dev

Known issues: #901

cla-bot[bot] commented 12 months ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Vakaris. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
cla-bot[bot] commented 12 months ago

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Vakaris. This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
vakarisbk commented 7 months ago

Seeing as there is some recent activity on Issue #814, and knowing that there are at least a couple of people actively using this fork, I've updated it. Looking forward for any insights regarding the implementation, as well as the likelihood of this pr getting merged.