Microsoft Build · May 19 – 22, 2025
Join developers and AI innovators to refactor your skills at Microsoft Build.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
spark_partition_id
Applies to: Databricks SQL Databricks Runtime
Returns the current partition ID.
spark_partition_id()
The function takes no arguments.
An INTEGER.
INTEGER
> SELECT spark_partition_id(); 0