title_wip

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/integrations/data-ingestion/azure-synapse/index.md)

ClickHouse Supported

[Azure Synapse](https://azure.microsoft.com/en-us/products/synapse-analytics) is an integrated analytics service that combines big data, data science and warehousing to enable fast, large-scale data analysis.
Within Synapse, Spark pools provide on-demand, scalable [Apache Spark](https://spark.apache.org) clusters that let you run complex data transformations, machine learning, and integrations with external systems.

This article will show you how to integrate the [ClickHouse Spark connector](/docs/integrations/apache-spark/spark-native-connector) when working with Apache Spark within Azure Synapse.

- [Add the connector's dependencies](#add-connector-dependencies)- [Add ClickHouse as a catalog](#add-clickhouse-as-catalog)- [Setup verification](#setup-verification)- [Additional resources](#additional-resources)

## Add the connector's dependencies[​](#add-connector-dependencies "Direct link to Add the connector's dependencies")

Azure Synapse supports three levels of [packages maintenance](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-azure-portal-add-libraries):

1. Default packages
2. Spark pool level
3. Session level

  

Follow the [Manage libraries for Apache Spark pools guide](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-manage-pool-packages) and add the following required dependencies to your Spark application

- `clickhouse-spark-runtime-{spark_version}_{scala_version}-{connector_version}.jar` - [official maven](https://mvnrepository.com/artifact/com.clickhouse.spark)
- `clickhouse-jdbc-{java_client_version}-all.jar` - [official maven](https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc)

Please visit our [Spark Connector Compatibility Matrix](/docs/integrations/apache-spark/spark-native-connector#compatibility-matrix) docs to understand which versions suit your needs.

## Add ClickHouse as a catalog[​](#add-clickhouse-as-catalog "Direct link to Add ClickHouse as a catalog")

There are a variety of ways to add Spark configs to your session:

- Custom configuration file to load with your session
- Add configurations via Azure Synapse UI
- Add configurations in your Synapse notebook

Follow this [Manage Apache Spark configuration](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-azure-create-spark-configuration)
and add the [connector required Spark configurations](/docs/integrations/apache-spark/spark-native-connector#register-the-catalog-required).

For instance, you can configure your Spark session in your notebook with these settings:

```
%%configure -f
{
    "conf": {
        "spark.sql.catalog.clickhouse": "com.clickhouse.spark.ClickHouseCatalog",
        "spark.sql.catalog.clickhouse.host": "<clickhouse host>",
        "spark.sql.catalog.clickhouse.protocol": "https",
        "spark.sql.catalog.clickhouse.http_port": "<port>",
        "spark.sql.catalog.clickhouse.user": "<username>",
        "spark.sql.catalog.clickhouse.password": "password",
        "spark.sql.catalog.clickhouse.database": "default"
    }
}
```

Make sure it will be in the first cell as follows:

Please visit the [ClickHouse Spark configurations page](/docs/integrations/apache-spark/spark-native-connector#configurations) for additional settings.

References

When working with ClickHouse Cloud Please make sure to set the [required Spark settings](/docs/integrations/apache-spark/spark-native-connector#clickhouse-cloud-settings).

## Setup verification[​](#setup-verification "Direct link to Setup verification")

To verify that the dependencies and configurations were set successfully, please visit your session's Spark UI, and go to your `Environment` tab.
There, look for your ClickHouse related settings:

## Additional resources[​](#additional-resources "Direct link to Additional resources")

- [ClickHouse Spark Connector Docs](/docs/integrations/apache-spark)
- [Azure Synapse Spark Pools Overview](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-overview)
- [Optimize performance for Apache Spark workloads](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-performance)
- [Manage libraries for Apache Spark pools in Synapse](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-manage-pool-packages)
- [Manage Apache Spark configuration in Synapse](https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-azure-create-spark-configuration)

- [Add the connector's dependencies](#add-connector-dependencies)- [Add ClickHouse as a catalog](#add-clickhouse-as-catalog)- [Setup verification](#setup-verification)- [Additional resources](#additional-resources)

Was this page helpful?