Skip to content

Conversation

@viirya
Copy link
Member

@viirya viirya commented Mar 26, 2018

What changes were proposed in this pull request?

As stated in Jira, there are problems with current Uuid expression which uses java.util.UUID.randomUUID for UUID generation.

This patch uses the newly added RandomUUIDGenerator for UUID generation. So we can make Uuid deterministic between retries.

This backports SPARK-23599 to Spark 2.3.

How was this patch tested?

Added tests.


val seed2 = Some(r.nextLong())
val uuid2 = evaluate(Uuid(seed2)).asInstanceOf[UTF8String]
assertIncorrectEval(() => checkEvaluationWithoutCodegen(Uuid(seed1), uuid2))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods like evaluateWithGeneratedMutableProjection seems not available in 2.3 branch. Currently I choose not to add too much change to ExpressionEvalHelper for this backport. So here I just call checkEvaluationXXX methods and expect exception with expected error message.

Copy link
Contributor

@hvanhovell hvanhovell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SparkQA
Copy link

SparkQA commented Mar 26, 2018

Test build #88582 has finished for PR 20903 at commit e1fca69.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class Uuid(randomSeed: Option[Long] = None) extends LeafExpression with Nondeterministic

@viirya
Copy link
Member Author

viirya commented Mar 26, 2018

retest this please.

@SparkQA
Copy link

SparkQA commented Mar 26, 2018

Test build #88587 has finished for PR 20903 at commit e1fca69.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • case class Uuid(randomSeed: Option[Long] = None) extends LeafExpression with Nondeterministic

@hvanhovell
Copy link
Contributor

Merging to 2.3. Thanks! Can you close?

asfgit pushed a commit that referenced this pull request Mar 26, 2018
…ession

## What changes were proposed in this pull request?

As stated in Jira, there are problems with current `Uuid` expression which uses `java.util.UUID.randomUUID` for UUID generation.

This patch uses the newly added `RandomUUIDGenerator` for UUID generation. So we can make `Uuid` deterministic between retries.

This backports SPARK-23599 to Spark 2.3.

## How was this patch tested?

Added tests.

Author: Liang-Chi Hsieh <[email protected]>

Closes #20903 from viirya/SPARK-23599-2.3.
@viirya
Copy link
Member Author

viirya commented Mar 26, 2018

Thanks! @hvanhovell

@viirya viirya closed this Mar 26, 2018
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
…ession

As stated in Jira, there are problems with current `Uuid` expression which uses `java.util.UUID.randomUUID` for UUID generation.

This patch uses the newly added `RandomUUIDGenerator` for UUID generation. So we can make `Uuid` deterministic between retries.

This backports SPARK-23599 to Spark 2.3.

Added tests.

Author: Liang-Chi Hsieh <[email protected]>

Closes apache#20903 from viirya/SPARK-23599-2.3.

Change-Id: I9b9e1b78e7ab527aa4d8fd8cdd1d0cf0942e5645
@viirya viirya deleted the SPARK-23599-2.3 branch December 27, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants