# Databricks Streaming Loader configuration reference
> Configure Databricks Streaming Loader with Unity Catalog, Kinesis, Pub/Sub, and Kafka settings for lakehouse streaming.
> Source: https://docs.snowplow.io/docs/api-reference/loaders-storage-targets/databricks-streaming-loader/configuration-reference/
> Documentation index: https://docs.snowplow.io/llms.txt

The configuration reference in this page is written for Databricks Streaming Loader `0.5.0`

### License

The Databricks Streaming Loader is released under the [Snowplow Limited Use License](/limited-use-license-1.1/) ([FAQ](/docs/licensing/limited-use-license-faq/)).

To accept the terms of license and run the loader, set the `ACCEPT_LIMITED_USE_LICENSE=yes` environment variable. Alternatively, configure the `license.accept` option in the config file:

```hocon
license: {
  accept: true
}
```

### Databricks configuration

| Parameter                        | Description                                                                                                                                                                                |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `output.good.host`               | Required, e.g. `https://{workspace-id}.cloud.databricks.com`. URL of the Databricks workspace.                                                                                             |
| `output.good.catalog`            | Required. Name of the Databricks catalog containing the volume.                                                                                                                            |
| `output.good.schema`             | Required. Name of the Databricks schema containing the volume.                                                                                                                             |
| `output.good.volume`             | Required. Name of the Databricks volume to which this loader will upload staging files. This must be an [external](https://docs.databricks.com/aws/en/volumes/managed-vs-external) volume. |
| `output.good.token`              | Required if using PAT authentication. A Databricks [personal access token](https://docs.databricks.com/aws/en/dev-tools/auth).                                                             |
| `output.good.oauth.clientId`     | Required if using OAUTH authentication. The client ID for a Databricks [service principal](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m).                                   |
| `output.good.oauth.clientSecret` | Required if using OAUTH authentication. The client secret for a Databricks [service principal](https://docs.databricks.com/aws/en/dev-tools/auth/oauth-m2m).                               |
| `output.good.compression`        | Optional. Default value `snappy`. Compression algorithm for the uploaded staging parquet files.                                                                                            |
| `output.good.httpTimeout`        | Optional. Default value `20 seconds`. Timeout duration of Databricks SDK's HTTP client.                                                                                                    |

### Streams configuration

**AWS:**

| Parameter                                           | Description                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input.streamName`                                  | Required. Name of the Kinesis stream with the enriched events                                                                                                                                                                                                                                                                                |
| `input.appName`                                     | Optional, default `snowplow-databricks-loader`. Name to use for the dynamodb table, used by the underlying Kinesis Consumer Library for managing leases.                                                                                                                                                                                     |
| `input.initialPosition.type`                        | Optional, default `LATEST`. Allowed values are `LATEST`, `TRIM_HORIZON`, `AT_TIMESTAMP`. When the loader is deployed for the first time, this controls from where in the kinesis stream it should start consuming events. On all subsequent deployments of the loader, the loader will resume from the offsets stored in the DynamoDB table. |
| `input.initialPosition.timestamp`                   | Required if `input.initialPosition` is `AT_TIMESTAMP`. A timestamp in ISO8601 format from where the loader should start consuming events.                                                                                                                                                                                                    |
| `input.retrievalMode`                               | Optional, default Polling. Change to FanOut to enable the enhance fan-out feature of Kinesis.                                                                                                                                                                                                                                                |
| `input.retrievalMode.maxRecords`                    | Optional. Default value 1000. How many events the Kinesis client may fetch in a single poll. Only used when `input.retrievalMode` is Polling.                                                                                                                                                                                                |
| `input.workerIdentifier`                            | Optional. Defaults to the `HOSTNAME` environment variable. The name of this KCL worker used in the dynamodb lease table.                                                                                                                                                                                                                     |
| `input.leaseDuration`                               | Optional. Default value `10 seconds`. The duration of shard leases. KCL workers must periodically refresh leases in the dynamodb table before this duration expires.                                                                                                                                                                         |
| `input.maxLeasesToStealAtOneTimeFactor`             | Optional. Default value `2.0`. Controls how to pick the max number of shard leases to steal at one time. E.g. If there are 4 available processors, and `maxLeasesToStealAtOneTimeFactor = 2.0`, then allow the loader to steal up to 8 leases. Allows bigger instances to more quickly acquire the shard-leases they need to combat latency. |
| `input.checkpointThrottledBackoffPolicy.minBackoff` | Optional. Default value `100 milliseconds`. Initial backoff used to retry checkpointing if we exceed the DynamoDB provisioned write limits.                                                                                                                                                                                                  |
| `input.checkpointThrottledBackoffPolicy.maxBackoff` | Optional. Default value `1 second`. Maximum backoff used to retry checkpointing if we exceed the DynamoDB provisioned write limits.                                                                                                                                                                                                          |
| `input.debounceCheckpoints`                         | Optional. Default value `10 seconds`. How frequently to checkpoint our progress to the DynamoDB table. By increasing this value, we can decrease the write-throughput requirements of the DynamoDB table.                                                                                                                                    |
| `input.maxRetries` (since 0.5.0)                    | Optional. Default value 10. Maximum number of retries for AWS SDK operations when reading from Kinesis.                                                                                                                                                                                                                                      |
| `input.apiCallAttemptTimeout` (since 0.5.0)         | Optional. Default value `15 seconds`. Maximum amount of time to wait for an individual Kinesis API call to complete.                                                                                                                                                                                                                         |
| `output.bad.streamName`                             | Required. Name of the Kinesis stream that will receive failed events.                                                                                                                                                                                                                                                                        |
| `output.bad.throttledBackoffPolicy.minBackoff`      | Optional. Default value `100 milliseconds`. Initial backoff used to retry sending failed events if we exceed the Kinesis write throughput limits.                                                                                                                                                                                            |
| `output.bad.throttledBackoffPolicy.maxBackoff`      | Optional. Default value `1 second`. Maximum backoff used to retry sending failed events if we exceed the Kinesis write throughput limits.                                                                                                                                                                                                    |
| `output.bad.recordLimit`                            | Optional. Default value 500. The maximum number of records we are allowed to send to Kinesis in 1 PutRecords request.                                                                                                                                                                                                                        |
| `output.bad.byteLimit`                              | Optional. Default value 5242880. The maximum number of bytes we are allowed to send to Kinesis in 1 PutRecords request.                                                                                                                                                                                                                      |
| `output.bad.maxRecordSize`                          | Optional. Default value 1000000. Any single event failed event sent to Kinesis should not exceed this size in bytes                                                                                                                                                                                                                          |
| `output.bad.maxRetries` (since 0.4.0)               | Optional. Default value 10. Maximum number of retries by Kinesis Client.                                                                                                                                                                                                                                                                     |

**GCP:**

| Parameter                                 | Description                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input.subscription`                      | Required, e.g. `projects/myproject/subscriptions/snowplow-enriched`. Name of the Pub/Sub subscription with the enriched events                                                                                                                                                                                                                                        |
| `input.durationPerAckExtension`           | Optional. Default value `15 seconds`. Pub/Sub ack deadlines are extended for this duration when needed.                                                                                                                                                                                                                                                               |
| `input.minRemainingAckDeadline`           | Optional. Default value `0.1`. Controls when ack deadlines are re-extended, for a message that is close to exceeding its ack deadline. For example, if `durationPerAckExtension` is `60 seconds` and `minRemainingAckDeadline` is `0.1` then the loader will wait until there is `6 seconds` left of the remining deadline, before re-extending the message deadline. |
| `input.maxMessagesPerPull`                | Optional. Default value 1000. How many Pub/Sub messages to pull from the server in a single request.                                                                                                                                                                                                                                                                  |
| `input.debounceRequests`                  | Optional. Default value `100 millis`. Adds an artifical delay between consecutive requests to Pub/Sub for more messages. Under some circumstances, this was found to slightly alleviate a problem in which Pub/Sub might re-deliver the same messages multiple times.                                                                                                 |
| `input.retries.transientErrors.delay`     | Optional. Default value `100 millis`. Backoff delay for follow-up attempts                                                                                                                                                                                                                                                                                            |
| `input.retries.transientErrors.attempts`  | Optional. Default value `10`. Max number of attempts, after which Enrich will crash and exit                                                                                                                                                                                                                                                                          |
| `output.bad.topic`                        | Required, e.g. `projects/myproject/topics/snowplow-bad`. Name of the Pub/Sub topic that will receive failed events.                                                                                                                                                                                                                                                   |
| `output.bad.batchSize`                    | Optional. Default value 1000. Bad events are sent to Pub/Sub in batches not exceeding this count.                                                                                                                                                                                                                                                                     |
| `output.bad.requestByteThreshold`         | Optional. Default value 1000000. Bad events are sent to Pub/Sub in batches with a total size not exceeding this byte threshold                                                                                                                                                                                                                                        |
| `output.bad.maxRecordSize`                | Optional. Default value 9000000. Any single failed event sent to Pub/Sub should not exceed this size in bytes                                                                                                                                                                                                                                                         |
| `output.retries.transientErrors.delay`    | Optional. Default value `100 millis`. Backoff delay for follow-up attempts                                                                                                                                                                                                                                                                                            |
| `output.retries.transientErrors.attempts` | Optional. Default value `10`. Max number of attempts, after which Enrich will crash and exit                                                                                                                                                                                                                                                                          |

**Azure:**

| Parameter                           | Description                                                                                                                                                                                  |
| ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input.topicName`                   | Required. Name of the Kafka topic for the source of enriched events.                                                                                                                         |
| `input.bootstrapServers`            | Required. Hostname and port of Kafka bootstrap servers hosting the source of enriched events.                                                                                                |
| `input.consumerConf.*`              | Optional. A map of key/value pairs for [any standard Kafka consumer configuration option](https://docs.confluent.io/platform/current/installation/configuration/consumer-configs.html).      |
| `input.debounceCommitOffsets`       | Optional. Default value 10 seconds. How frequently to commit our progress back to kafka. By increasing this value, we decrease the number of requests made to the kafka broker.              |
| `input.commitTimeout` (since 0.4.0) | Optional. Default value 15 seconds. The time to wait for offset commits to complete. If an offset commit doesn't complete within this time, a CommitTimeoutException will be raised instead. |
| `output.bad.topicName`              | Required. Name of the Kafka topic that will receive failed events.                                                                                                                           |
| `output.bad.bootstrapServers`       | Required. Hostname and port of Kafka bootstrap servers hosting the bad topic                                                                                                                 |
| `output.bad.producerConf.*`         | Optional. A map of key/value pairs for [any standard Kafka producer configuration option](https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html).      |
| `output.bad.maxRecordSize`          | Optional. Default value 1000000. Any single failed event sent to Kafka should not exceed this size in bytes                                                                                  |

> **Info: Event Hubs Authentication**
>
> You can use the `input.consumerConf` and `output.bad.producerConf` options to configure authentication to Azure event hubs using SASL. For example:
>
> ```hocon
> input: {
>   consumerConf: {
>     "security.protocol": SASL_SSL
>     "sasl.mechanism": PLAIN
>     "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=\"$ConnectionString\" password=<PASSWORD>;"
>   }
> }
> ```

***

## Other configuration options

| Parameter                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batching.maxBytes`                                  | Optional. Default value `16000000`. Events are uploaded to the Databricks volume when the batch reaches this size in bytes                                                                                                                                                                                                                                                                                                            |
| `batching.maxDelay`                                  | Optional. Default value `1 second`. Events are uploaded to the Databricks volume after a maximum of this duration, even if the `maxBytes` size has not been reached                                                                                                                                                                                                                                                                   |
| `batching.uploadParallelismFactor`                   | Optional. Default value 3. Controls how many batches can we send simultaneously over the network to Databricks. E.g. If there are 4 available processors, and `uploadParallelismFactor` is 3.5, then the loader sends up to 14 batches in parallel. Adjusting this value can cause the app to use more or less of the available CPU.                                                                                                  |
| `cpuParallelismFactor`                               | Optional. Default value 0.75. Controls how the app splits the workload into concurrent batches which can be run in parallel. E.g. If there are 4 available processors, and `cpuParallelismFactor` is 0.75, then the loader processes 3 batches concurrently. Adjusting this value can cause the app to use more or less of the available CPU.                                                                                         |
| `retries.setupErrors.delay`                          | Optional. Default value `30 seconds`. Configures exponential backoff on errors related to how Databricks is set up for this loader. Examples include authentication errors and permissions errors. This class of errors are reported periodically to the monitoring webhook.                                                                                                                                                          |
| `retries.transientErrors.delay`                      | Optional. Default value `1 second`. Configures exponential backoff on errors that are likely to be transient. Examples include server errors and network errors.                                                                                                                                                                                                                                                                      |
| `retries.transientErrors.attempts`                   | Optional. Default value 5. Maximum number of attempts to make before giving up on a transient error.                                                                                                                                                                                                                                                                                                                                  |
| `skipSchemas`                                        | Optional, e.g. `["iglu:com.example/skipped1/jsonschema/1-0-0"]` or with wildcards `["iglu:com.example/skipped2/jsonschema/1--"]`. A list of schemas that won't be loaded to Databricks. This feature could be helpful when recovering from edge-case schemas which for some reason cannot be loaded to the table.                                                                                                                     |
| `decompression.maxBytesInBatch` (since 0.5.0)        | Optional. Default value `5242880` (5 MB).The loader automatically detects and decompresses zstd- or gzip-compressed source messages. Uncompressed messages are unaffected.The loader uses this as a cutoff when incrementally adding decompressed events to a batch, and emits the batch as soon as it reaches this size. This protects the loader's memory because a small compressed message can expand into a much larger payload. |
| `decompression.maxBytesSinglePayload` (since 0.5.0)  | Optional. Default value `10000000` (10 MB).For zstd- or gzip-compressed source messages, this is the maximum size of a single payload after decompression. The loader emits a [size violation failed event](/docs/api-reference/failed-events/#size-violation) for any payload that exceeds this size.                                                                                                                                |
| `exitOnMissingIgluSchema`                            | Optional. Default value `true`. Whether the loader should crash and exit if it fails to resolve an Iglu Schema. We recommend `true` because Snowplow enriched events have already passed validation, so a missing schema normally indicates an error that needs addressing. Change to `false` so events go the failed events stream instead of crashing the loader.                                                                   |
| `monitoring.metrics.statsd.hostname`                 | Optional. If set, the loader sends statsd metrics over UDP to a server on this host name.                                                                                                                                                                                                                                                                                                                                             |
| `monitoring.metrics.statsd.port`                     | Optional. Default value 8125. If the statsd server is configured, this UDP port is used for sending metrics.                                                                                                                                                                                                                                                                                                                          |
| `monitoring.metrics.statsd.tags.*`                   | Optional. A map of key/value pairs to be sent along with the statsd metric.                                                                                                                                                                                                                                                                                                                                                           |
| `monitoring.metrics.statsd.period`                   | Optional. Default `1 minute`. How often to report metrics to statsd.                                                                                                                                                                                                                                                                                                                                                                  |
| `monitoring.metrics.statsd.prefix`                   | Optional. Default `snowplow.databricks-loader`. Prefix used for the metric name when sending to statsd.                                                                                                                                                                                                                                                                                                                               |
| `monitoring.metrics.prometheus.tags.*` (since 0.5.0) | Optional. A map of key/value pairs added as common labels on every Prometheus metric. The loader exposes these metrics at the `/metrics` endpoint on the health probe port.                                                                                                                                                                                                                                                           |
| `monitoring.webhook.endpoint`                        | Optional, e.g. `https://webhook.example.com`. The loader will send to the webhook a payload containing details of any error related to how Databricks is set up for this loader.                                                                                                                                                                                                                                                      |
| `monitoring.webhook.tags.*`                          | Optional. A map of key/value strings to be included in the payload content sent to the webhook.                                                                                                                                                                                                                                                                                                                                       |
| `monitoring.webhook.heartbeat.*`                     | Optional. Default value `5.minutes`. How often to send a heartbeat event to the webhook when healthy.                                                                                                                                                                                                                                                                                                                                 |
| `monitoring.sentry.dsn`                              | Optional. Set to a Sentry URI to report unexpected runtime exceptions.                                                                                                                                                                                                                                                                                                                                                                |
| `monitoring.sentry.tags.*`                           | Optional. A map of key/value strings which are passed as tags when reporting exceptions to Sentry.                                                                                                                                                                                                                                                                                                                                    |
| `telemetry.disable`                                  | Optional. Set to `true` to disable [telemetry](/docs/get-started/self-hosted/telemetry/).                                                                                                                                                                                                                                                                                                                                             |
| `telemetry.userProvidedId`                           | Optional. See [here](/docs/get-started/self-hosted/telemetry/#how-can-i-help) for more information.                                                                                                                                                                                                                                                                                                                                   |
| `http.client.maxConnectionsPerServer`                | Optional. Default value 4. Configures the internal HTTP client used for iglu resolver, alerts and telemetry. The maximum number of open HTTP requests to any single server at any one time.                                                                                                                                                                                                                                           |
