Skip to content

[SPARK-17571][SQL] AssertOnQuery.condition should always return Boolean value#15127

Closed
petermaxlee wants to merge 2 commits into
apache:masterfrom
petermaxlee:SPARK-17571
Closed

[SPARK-17571][SQL] AssertOnQuery.condition should always return Boolean value#15127
petermaxlee wants to merge 2 commits into
apache:masterfrom
petermaxlee:SPARK-17571

Conversation

@petermaxlee

@petermaxlee petermaxlee commented Sep 17, 2016

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

AssertOnQuery has two apply constructor: one that accepts a closure that returns boolean, and another that accepts a closure that returns Unit. This is actually very confusing because developers could mistakenly think that AssertOnQuery always require a boolean return type and verifies the return result, when indeed the value of the last statement is ignored in one of the constructors.

This pull request makes the two constructor consistent and always require boolean value. It will overall make the test suites more robust against developer errors.

As an evidence for the confusing behavior, this change also identified a bug with an existing test case due to file system time granularity. This pull request fixes that test case as well.

How was this patch tested?

This is a test only change.

@petermaxlee

Copy link
Copy Markdown
Contributor Author

cc @tdas @zsxwing

@SparkQA

SparkQA commented Sep 17, 2016

Copy link
Copy Markdown

Test build #65530 has finished for PR 15127 at commit 008eb07.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

SparkQA commented Sep 18, 2016

Copy link
Copy Markdown

Test build #65549 has finished for PR 15127 at commit d013acf.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin

rxin commented Sep 18, 2016

Copy link
Copy Markdown
Contributor

Merging in master/2.0.

@asfgit asfgit closed this in 8f0c35a Sep 18, 2016
asfgit pushed a commit that referenced this pull request Sep 18, 2016
…an value

## What changes were proposed in this pull request?
AssertOnQuery has two apply constructor: one that accepts a closure that returns boolean, and another that accepts a closure that returns Unit. This is actually very confusing because developers could mistakenly think that AssertOnQuery always require a boolean return type and verifies the return result, when indeed the value of the last statement is ignored in one of the constructors.

This pull request makes the two constructor consistent and always require boolean value. It will overall make the test suites more robust against developer errors.

As an evidence for the confusing behavior, this change also identified a bug with an existing test case due to file system time granularity. This pull request fixes that test case as well.

## How was this patch tested?
This is a test only change.

Author: petermaxlee <petermaxlee@gmail.com>

Closes #15127 from petermaxlee/SPARK-17571.

(cherry picked from commit 8f0c35a)
Signed-off-by: Reynold Xin <rxin@databricks.com>
wgtmac pushed a commit to wgtmac/spark that referenced this pull request Sep 19, 2016
…an value

## What changes were proposed in this pull request?
AssertOnQuery has two apply constructor: one that accepts a closure that returns boolean, and another that accepts a closure that returns Unit. This is actually very confusing because developers could mistakenly think that AssertOnQuery always require a boolean return type and verifies the return result, when indeed the value of the last statement is ignored in one of the constructors.

This pull request makes the two constructor consistent and always require boolean value. It will overall make the test suites more robust against developer errors.

As an evidence for the confusing behavior, this change also identified a bug with an existing test case due to file system time granularity. This pull request fixes that test case as well.

## How was this patch tested?
This is a test only change.

Author: petermaxlee <petermaxlee@gmail.com>

Closes apache#15127 from petermaxlee/SPARK-17571.
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