Skip to content

[SPARK-22363][SQL][TEST] Add unit test for Window spilling#20022

Closed
gaborgsomogyi wants to merge 2 commits intoapache:masterfrom
gaborgsomogyi:SPARK-22363
Closed

[SPARK-22363][SQL][TEST] Add unit test for Window spilling#20022
gaborgsomogyi wants to merge 2 commits intoapache:masterfrom
gaborgsomogyi:SPARK-22363

Conversation

@gaborgsomogyi
Copy link
Contributor

What changes were proposed in this pull request?

There is already test using window spilling, but the test coverage is not ideal.

In this PR the already existing test was fixed and additional cases added.

How was this patch tested?

Automated: Pass the Jenkins.

@gaborgsomogyi gaborgsomogyi changed the title Add unit test for Window spilling [SPARK-22361][SQL][TEST] Add unit test for Window spilling Dec 19, 2017
@gaborgsomogyi gaborgsomogyi changed the title [SPARK-22361][SQL][TEST] Add unit test for Window spilling [SPARK-22363][SQL][TEST] Add unit test for Window spilling Dec 19, 2017
@gaborgsomogyi
Copy link
Contributor Author

Copy link
Contributor

@jiangxb1987 jiangxb1987 left a comment

Choose a reason for hiding this comment

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

Looks pretty good, also cc @gatorsmile @cloud-fan

test("SPARK-21258: complex object in combination with spilling") {
// Make sure we trigger the spilling path.
withSQLConf(SQLConf.WINDOW_EXEC_BUFFER_SPILL_THRESHOLD.key -> "17") {
withSQLConf(SQLConf.WINDOW_EXEC_BUFFER_IN_MEMORY_THRESHOLD.key -> "0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why should we set this value to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

WINDOW_EXEC_BUFFER_IN_MEMORY_THRESHOLD drives how much items is guaranteed to kept in memory. If this limit is not hit spilling not considered.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, i mean, how about set it to 1 instead of 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, now I see 🙂 Sure, I'll set it soon.

Copy link
Member

Choose a reason for hiding this comment

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

We can accept any value. No limit. both are fine.

@cloud-fan
Copy link
Contributor

OK to test

@gatorsmile
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Dec 30, 2017

Test build #85540 has finished for PR 20022 at commit a4a0cfc.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gatorsmile
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Dec 30, 2017

Test build #85547 has finished for PR 20022 at commit a4a0cfc.

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

df.select($"key", sum("value").over(window)).collect()
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Normally, we will create a helper function for avoiding the duplicate codes. Since the test cases are pretty small, it is also fine.

@gatorsmile
Copy link
Member

LGTM

@gatorsmile
Copy link
Member

Thanks! Merged to master.

@asfgit asfgit closed this in ee3af15 Dec 31, 2017
@gaborgsomogyi
Copy link
Contributor Author

@gatorsmile @cloud-fan @jiangxb1987 Thanks for the help!

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.

5 participants