Mateusz Buśkiewicz created SPARK-15382:
------------------------------------------

             Summary: monotonicallyIncreasingId doesn't work when data is 
upsampled
                 Key: SPARK-15382
                 URL: https://issues.apache.org/jira/browse/SPARK-15382
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 1.6.1
            Reporter: Mateusz Buśkiewicz


Assigned ids are not unique

{code}
from pyspark.sql import Row
from pyspark.sql.functions import monotonicallyIncreasingId

hiveContext.createDataFrame([Row(a=1), Row(a=2)]).sample(True, 
10.0).withColumn('id', monotonicallyIncreasingId()).collect()
{code}

Output:

{code}
[Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=1, id=429496729600),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792),
 Row(a=2, id=867583393792)]
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to