GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/13768

    Add `spark_partition_id` in SparkR

    ## What changes were proposed in this pull request?
    
    This PR adds `spark_partition_id` virtual column function in SparkR for API 
parity.
    
    The following is just an example to illustrate a SparkR usage on a 
partitioned parquet table created by 
`spark.range(10).write.mode("overwrite").parquet("/tmp/t1")`.
    ```r
    > collect(select(read.parquet('/tmp/t1'), c('id', spark_partition_id())))
       id SPARK_PARTITION_ID()
    1   3                    0
    2   4                    0
    3   8                    1
    4   9                    1
    5   0                    2
    6   1                    3
    7   2                    4
    8   5                    5
    9   6                    6
    10  7                    7
    ```
    
    ## How was this patch tested?
    
    Pass the Jenkins tests (including new testcase).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-16053

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/13768.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13768
    
----
commit 26b9781f047a650a8f9e70b612c168643464ae80
Author: Dongjoon Hyun <[email protected]>
Date:   2016-06-19T06:59:07Z

    Add `spark_partition_id` in SparkR

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to