---
title: spark_partition_id function
description: Learn the syntax of the spark\_partition\_id function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/spark_partition
---

# `spark_partition_id` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Returns the current partition ID.

## Syntax

```
spark_partition_id()
```

## Arguments

The function takes no arguments.

## Returns

An `INTEGER`.

## Examples

```sql
> SELECT spark_partition_id();
 0
```

## Related functions
