SparkR (version 2.1.2)

spark_partition_id: Return the partition ID as a column

Description

Return the partition ID as a SparkDataFrame column. Note that this is nondeterministic because it depends on data partitioning and task scheduling.

Usage

spark_partition_id(x = "missing")

# S4 method for missing spark_partition_id()

Arguments

x

empty. Should be used with no argument.

Details

This is equivalent to the SPARK_PARTITION_ID function in SQL.

Examples

Run this code
# NOT RUN {
select(df, spark_partition_id())
# }

Run the code above in your browser using DataCamp Workspace