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

Metadata

Release files for in-dbt-spark 1.9.54

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.54
File Size Uploaded
in_dbt_spark-1.9.54.tar.gz 153.9 kB Details

Built distribution (wheel)

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

Total release size: 283.2 kB

Release files / in_dbt_spark-1.9.54.tar.gz

Download URL in_dbt_spark-1.9.54.tar.gz
Size 153.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7a9a9f20c71abdb086d04bffd34aaad87836f5a4b4f16f14b920965385c284a5
BLAKE2b-256 checksum
How to use checksums
c972a12c946a4f719ef2afac74d602d5e44717604a3b1b61cfc129ef073b2ce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL in_dbt_spark-1.9.54-py3-none-any.whl
Size 129.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c32727049bdb555636e1a7492ab66e9cf5d9896e9a649cbb0993effb1c0dac58
BLAKE2b-256 checksum
How to use checksums
0de3e8afd1958720dca6511f1c94ecac94d01265c082bb6be894fbf7d57949f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.9.54 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