Skip to main content
(Applies to dbt v2.0 and later)

Connect Apache Spark to Fusion Beta

The dbt Fusion engine supports Apache Spark, enabling faster compilation and execution for your Spark-based dbt projects. Currently, Fusion only supports Apache Spark 3.0.

Fusion and Spark

Fusion uses the Databricks SQL dialect for static analysis when working with Spark. Databricks SQL is a superset of Spark SQL, so your SQL is validated with Databricks semantics. This provides comprehensive error checking and SQL comprehension features. A dedicated Spark SQL dialect for static analysis is planned for a future release.

Authentication

The Spark adapter in Fusion supports:

  • Thrift
    • Simple Authentication and Security Layer (SASL) PLAIN
    • No SASL (NOSASL)
  • Livy
    • Basic authentication (username and password)
    • When deployed on Amazon Web Services (AWS): AWS Signature Version 4
      • Supports authentication using single sign-on, service accounts, or user tokens

Configure Fusion

Configure your Spark connection in profiles.yml:

~/.dbt/profiles.yml
your_profile_name:
target: dev
outputs:
dev:
type: spark
method: CONNECTION_METHOD # thrift, http, or livy
port: PORT_NUMBER
auth: AUTH_METHOD
schema: SCHEMA_NAME
host: HOSTNAME
platform_hint: PLATFORM_HINT # optional; aws_emr_serverless or aws_emr_eks
server_side_parameters: # optional; required keys depend on platform_hint
livy.server.session.ttl: SESSION_TTL_SECONDS # optional when using method: livy
Profile fieldRequiredDescriptionExample
methodYesConnection method. Accepted values: thrift, http, or livy.thrift
portYesPort number for the connection.443
authYesAuthentication method.SASL PLAIN, NOSASL, AWS_SIGV4
schemaYesThe database or schema name where dbt will create and query objects.analytics
hostYesHostname of the Spark cluster or Databricks workspace.yourorg.sparkhost.com
platform_hintNoHints to Fusion which Spark platform you use. Fusion uses this to validate required server_side_parameters. Accepted values: aws_emr_serverless, aws_emr_eks. If omitted, Fusion assumes a generic Spark cluster.aws_emr_serverless
server_side_parametersNoSpark session parameters passed to the cluster.

Required keys when using platform_hint:
- For aws_emr_serverless, use emr-serverless.session.executionRoleArn.
- For aws_emr_eks, use spark.kubernetes.namespace.

When using method: livy, you can set livy.server.session.ttl to configure how long a session can remain idle before it is terminated.
Refer to example profiles.

Example profiles

~/.dbt/profiles.yml
spark-local-thrift-binary:
target: spark
outputs:
spark:
type: spark
method: thrift
port: 10000
auth: NOSASL
host: localhost
schema: my_schema

For detailed configuration options, refer to the Spark configuration page.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading