Skip to main content

dbt logo

dbt

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.

dbt is the T in ELT. Organize, cleanse, denormalize, filter, rename, and pre-aggregate the raw data in your warehouse so that it's ready for analysis.

dbt-spark

dbt-spark enables dbt to work with Apache Spark. For more information on using dbt with Spark, consult the docs.

Getting started

Review the repository README.md as most of that information pertains to dbt-spark.

Running locally

A docker-compose environment starts a Spark Thrift server and a Postgres database as a Hive Metastore backend. Note: dbt-spark now supports Spark 3.3.2.

The following command starts two docker containers:

docker-compose up -d

It will take a bit of time for the instance to start, you can check the logs of the two containers. If the instance doesn't start correctly, try the complete reset command listed below and then try start again.

Create a profile like this one:

spark_testing:
  target: local
  outputs:
    local:
      type: spark
      method: thrift
      host: 127.0.0.1
      port: 10000
      user: dbt
      schema: analytics
      connect_retries: 5
      connect_timeout: 60
      retry_all: true

Connecting to the local spark instance:

  • The Spark UI should be available at http://localhost:4040/sqlserver/
  • The endpoint for SQL-based testing is at http://localhost:10000 and can be referenced with the Hive or Spark JDBC drivers using connection string jdbc:hive2://localhost:10000 and default credentials dbt:dbt

Note that the Hive metastore data is persisted under ./.hive-metastore/, and the Spark-produced data under ./.spark-warehouse/. To completely reset you environment run the following:

docker-compose down
rm -rf ./.hive-metastore/
rm -rf ./.spark-warehouse/

Additional Configuration for MacOS

If installing on MacOS, use homebrew to install required dependencies.

brew install unixodbc

Contribute

Release files for in-dbt-spark 1.9.52

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for in-dbt-spark 1.9.52
File Size Uploaded
in_dbt_spark-1.9.52.tar.gz 148.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for in-dbt-spark 1.9.52
File Interpreter ABI Platform
in_dbt_spark-1.9.52-py3-none-any.whl Python 3 none any Details

Total release size: 276.9 kB

Release files / in_dbt_spark-1.9.52.tar.gz

Download URL in_dbt_spark-1.9.52.tar.gz
Size 148.5 kB
Tags Source
SHA-256 checksum
How to use checksums
16c121c67704d04998e872f7890fa272cdcdd43421188d1a1b4d973f40c5c1cb
BLAKE2b-256 checksum
How to use checksums
83b0bc97a4350a79c580c7b3ca5d6abbf2a8c3962a6393ef47c899443b8451a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / in_dbt_spark-1.9.52-py3-none-any.whl

Download URL in_dbt_spark-1.9.52-py3-none-any.whl
Size 128.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
061748b0bca604ea892cf258622f859539a216343fe4af2f715df33dd0b73961
BLAKE2b-256 checksum
How to use checksums
e3494c2376e1217a6abc0f437ad9d321380be674ee8ea8a1a8e7b4c56537f862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.9.52 This release

2 release files

1.9.51

2 release files

1.9.50

2 release files

1.9.48

2 release files

1.9.47

2 release files

1.9.46

2 release files

1.9.45

2 release files

1.9.44

2 release files

1.9.41

2 release files

1.9.40

2 release files

1.9.39

2 release files

1.9.38

2 release files

1.9.37

2 release files

1.9.36

2 release files

1.9.34

2 release files

1.9.33

2 release files

1.9.32

2 release files

1.9.31

2 release files

1.9.30

2 release files

1.9.29

2 release files

1.9.28

2 release files

1.9.27

2 release files

1.9.26

2 release files

1.9.25

2 release files

1.9.24

2 release files

1.9.23

2 release files

1.9.16

2 release files

1.9.15

2 release files

1.9.14

2 release files

1.9.13

2 release files

1.9.9

2 release files

1.9.8

2 release files

1.9.7

2 release files

1.9.6

2 release files

1.9.5

2 release files

1.9.4

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.5.16

2 release files

1.5.15

2 release files

1.5.14

2 release files

1.5.13

2 release files

1.5.11

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.0

2 release files

1.2.8

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page