-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-23415][SQL][TEST] Make behavior of BufferHolderSparkSubmitSuite correct and stable #20636
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
Changes from 10 commits
0ccf992
a92e97c
981aba5
c0fb167
e3cd821
4e9aa75
2ab6ee6
517a42e
96f8eff
a134091
84940ee
2dd1b82
5e59aca
81d6477
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,8 +39,8 @@ class BufferHolderSparkSubmitSuite | |
| val argsForSparkSubmit = Seq( | ||
| "--class", BufferHolderSparkSubmitSuite.getClass.getName.stripSuffix("$"), | ||
| "--name", "SPARK-22222", | ||
| "--master", "local-cluster[2,1,1024]", | ||
| "--driver-memory", "4g", | ||
| "--master", "local-cluster[1,1,7168]", | ||
| "--driver-memory", "7g", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, just wondering if it's going to be problematic that the test now spawns a job that needs more than 7G of RAM? maybe I misunderstand. |
||
| "--conf", "spark.ui.enabled=false", | ||
| "--conf", "spark.master.rest.enabled=false", | ||
| "--conf", "spark.driver.extraJavaOptions=-ea", | ||
|
|
@@ -55,22 +55,30 @@ object BufferHolderSparkSubmitSuite { | |
|
|
||
| val ARRAY_MAX = ByteArrayMethods.MAX_ROUNDED_ARRAY_LENGTH | ||
|
|
||
| val holder = new BufferHolder(new UnsafeRow(1000)) | ||
| val unsafeRow = new UnsafeRow(1000) | ||
| val holder = new BufferHolder(unsafeRow) | ||
|
|
||
| holder.reset() | ||
| holder.grow(roundToWord(ARRAY_MAX / 2)) | ||
|
|
||
| holder.reset() | ||
| holder.grow(roundToWord(ARRAY_MAX / 2 + 8)) | ||
| // while to reuse a buffer may happen, this test checks whether the buffer can be grown | ||
| holder.grow(ARRAY_MAX / 2) | ||
| assert(unsafeRow.getSizeInBytes % 8 == 0) | ||
|
|
||
| holder.reset() | ||
| holder.grow(roundToWord(Integer.MAX_VALUE / 2)) | ||
| holder.grow(ARRAY_MAX / 2 + 7) | ||
| assert(unsafeRow.getSizeInBytes % 8 == 0) | ||
|
|
||
| holder.reset() | ||
| holder.grow(roundToWord(Integer.MAX_VALUE)) | ||
| } | ||
| holder.grow(Integer.MAX_VALUE / 2) | ||
| assert(unsafeRow.getSizeInBytes % 8 == 0) | ||
|
|
||
| holder.grow(ARRAY_MAX - holder.totalSize()) | ||
| assert(unsafeRow.getSizeInBytes % 8 == 0) | ||
|
|
||
| private def roundToWord(len: Int): Int = { | ||
| ByteArrayMethods.roundNumberOfBytesToNearestWord(len) | ||
| try { | ||
| holder.grow(ARRAY_MAX + 1 - holder.totalSize()) | ||
| assert(false) | ||
| } catch { | ||
| case _: UnsupportedOperationException => assert(true) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the indents here. |
||
| case _: Throwable => assert(false) | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still support this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Several tests still seem to use
local-cluster. Is it better to uselocalwhile it may require more memory?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @hvanhovell
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we support this for testing purpose since, IIRC, that's going to make separate processes for workers.