spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph K. Bradley (JIRA)" <>
Subject [jira] [Commented] (SPARK-17833) 'monotonicallyIncreasingId()' should be deterministic
Date Thu, 04 May 2017 00:58:04 GMT


Joseph K. Bradley commented on SPARK-17833:

I'll add: There definitely needs to be a deterministic version in order to compute row indices.
 In my case, this is important for GraphFrames.  The last time I checked, you can get non-deterministic
behavior by, e.g., shuffling a DataFrame, adding a monotonicallyIncreasingId column, and inspecting.

> 'monotonicallyIncreasingId()' should be deterministic
> -----------------------------------------------------
>                 Key: SPARK-17833
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Kevin Ushey
>            Priority: Critical
> Right now, it's (IMHO) too easy to shoot yourself in the foot using 'monotonicallyIncreasingId()',
as it's easy to expect the generated numbers to function as a 'stable' primary key, for example,
and then go on to use that key in e.g. 'joins' and so on.
> Is there any reason why this function can't be made deterministic? Or, could a deterministic
analogue of this function be added (e.g. 'withPrimaryKey(columnName = ...)')?
> A solution is to immediately cache / persist the table after calling 'monotonicallyIncreasingId()';
it's also possible that the documentation should spell that out loud and clear.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message