Skip to main content
JDBC is one of the most commonly used data sources in Spark. In this section, we will provide details on how to use the ClickHouse official JDBC connector with Spark.

Read data

Write data

Parallelism

When using Spark JDBC, Spark reads the data using a single partition. To achieve higher concurrency, you must specify partitionColumn, lowerBound, upperBound, and numPartitions, which describe how to partition the table when reading in parallel from multiple workers. Please visit Apache Spark’s official documentation for more information on JDBC configurations.

JDBC limitations

  • Spark JDBC lacks support for complex types (MAP, ARRAY, STRUCT) due to missing ClickHouse dialect - use the native Spark-ClickHouse connector for full complex type support.
  • As of today, you can insert data using JDBC only into existing tables (currently, there is no way to auto-create the table on DF insertion, as Spark does with other connectors).
Last modified on June 19, 2026