Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-19050][SS][Tests]Fix EventTimeWatermarkSuite 'delay in months and years handled correctly' #16449

Closed
wants to merge 1 commit into from
Closed

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jan 1, 2017

What changes were proposed in this pull request?

monthsSinceEpoch in this test is like math.floor(num), so monthDiff has two possible values.

How was this patch tested?

Jenkins.

@zsxwing
Copy link
Member Author

zsxwing commented Jan 1, 2017

cc @gatorsmile @tdas

@zsxwing
Copy link
Member Author

zsxwing commented Jan 1, 2017

I will merge this PR once this test passes since the master is broken now.

@zsxwing zsxwing changed the title [SPARK-19050][SS]Fix EventTimeWatermarkSuite 'delay in months and years handled correctly [SPARK-19050][SS][Tests]Fix EventTimeWatermarkSuite 'delay in months and years handled correctly Jan 1, 2017
@zsxwing zsxwing changed the title [SPARK-19050][SS][Tests]Fix EventTimeWatermarkSuite 'delay in months and years handled correctly [SPARK-19050][SS][Tests]Fix EventTimeWatermarkSuite 'delay in months and years handled correctly' Jan 1, 2017
@zsxwing
Copy link
Member Author

zsxwing commented Jan 1, 2017

Merging to master and 2.1

asfgit pushed a commit that referenced this pull request Jan 1, 2017
… and years handled correctly'

## What changes were proposed in this pull request?

`monthsSinceEpoch` in this test is like `math.floor(num)`, so `monthDiff` has two possible values.

## How was this patch tested?

Jenkins.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes #16449 from zsxwing/watermark-test-hotfix.

(cherry picked from commit 2394047)
Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
@asfgit asfgit closed this in 2394047 Jan 1, 2017
@SparkQA
Copy link

SparkQA commented Jan 1, 2017

Test build #70777 has finished for PR 16449 at commit c456c6e.

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

@zsxwing zsxwing deleted the watermark-test-hotfix branch January 2, 2017 02:23
@gatorsmile
Copy link
Member

It sounds like our watermarkTime delay calculation causes this issue. Below are two typical cases:

Case 1: when setting the watermark delay to 1 month interval:

      .withWatermark("eventTime", "1 months")

the watermarket time is Thu Dec 01 20:05:34 PST 2016 and the current time is Sun Jan 01 20:05:34 PST 2017

Case 2: when setting the watermark delay to 1 month interval:

      .withWatermark("eventTime", "29 months")

the watermarket time is Thu Jul 17 21:10:50 PDT 2014 and the current time is Sun Jan 01 20:10:50 PST 2017

It sounds like it is caused by our intentional over-estimation (that is, by using 31 days per month)?

@zsxwing
Copy link
Member Author

zsxwing commented Jan 2, 2017

the watermarket time is Thu Jul 17 21:10:50 PDT 2014 and the current time is Sun Jan 01 20:10:50 PST 2017
It sounds like it is caused by our intentional over-estimation (that is, by using 31 days per month)?

@gatorsmile this is an expected behavior. It's intentional and it's correct as per the comment in Dataset.withWatermark,

the actual watermark used is only guaranteed to be at least delayThreshold behind the actual event time. In some cases we may still process records that arrive more than delayThreshold late.

If the user wants to filter data accurately, they need to use filter explicitly.

That's why I changed the test rather than the watermark calculation.

@gatorsmile
Copy link
Member

Yeah, agree. This is a bug in the test cases. Thanks!

cmonkey pushed a commit to cmonkey/spark that referenced this pull request Jan 4, 2017
… and years handled correctly'

## What changes were proposed in this pull request?

`monthsSinceEpoch` in this test is like `math.floor(num)`, so `monthDiff` has two possible values.

## How was this patch tested?

Jenkins.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16449 from zsxwing/watermark-test-hotfix.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
… and years handled correctly'

## What changes were proposed in this pull request?

`monthsSinceEpoch` in this test is like `math.floor(num)`, so `monthDiff` has two possible values.

## How was this patch tested?

Jenkins.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16449 from zsxwing/watermark-test-hotfix.
ashangit pushed a commit to ashangit/spark that referenced this pull request Apr 21, 2017
… and years handled correctly'

## What changes were proposed in this pull request?

`monthsSinceEpoch` in this test is like `math.floor(num)`, so `monthDiff` has two possible values.

## How was this patch tested?

Jenkins.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16449 from zsxwing/watermark-test-hotfix.

(cherry picked from commit 2394047)
Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
ashangit pushed a commit to ashangit/spark that referenced this pull request Apr 21, 2017
… and years handled correctly'

## What changes were proposed in this pull request?

`monthsSinceEpoch` in this test is like `math.floor(num)`, so `monthDiff` has two possible values.

## How was this patch tested?

Jenkins.

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16449 from zsxwing/watermark-test-hotfix.

(cherry picked from commit 2394047)
Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants