You can write subclass of Partitioner whose getPartition() returns
partition number corresponding to the given key.

Take a look at
core/src/main/scala/org/apache/spark/api/python/PythonPartitioner.scala for
an example.

Cheers

On Sun, Jul 26, 2015 at 1:43 PM, Hafiz Mujadid <hafizmujadi...@gmail.com>
wrote:

> Hi
>
> I have csv data in which i have a column of date time. I want to partition
> my data in 12 partitions with each partition containing data of one month
> only. I am not getting how to write such partitioner and how to use that
> partitioner to read write data.
>
> Kindly help me in this regard.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/Custom-partitioner-tp24001.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
> For additional commands, e-mail: user-h...@spark.apache.org
>
>

Reply via email to