I suggest you to use `monotonicallyIncreasingId` which is high efficient.
But note that the ID it generated will not be consecutive.
On Fri, Sep 29, 2017 at 3:21 PM, Kanagha Kumar
wrote:
> Thanks for the response.
> I can use either row_number() or monotonicallyIncreasingId to generate
> uniqueI
Thanks for the response.
I can use either row_number() or monotonicallyIncreasingId to generate
uniqueIds as in
https://hadoopist.wordpress.com/2016/05/24/generate-unique-ids-for-each-rows-in-a-spark-dataframe/
I'm looking for a java example to use that to replicate a single row n
times by appendi
How about using row number for primary key?
Select row_number() over (), * from table
On Fri, 29 Sep 2017 at 10:21 am, Kanagha Kumar
wrote:
> Hi,
>
> I'm trying to replicate a single row from a dataset n times and create a
> new dataset from it. But, while replicating I need a column's value to