-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-7862][SQL]Fix the deadlock in script transformation for stderr #6404
Changes from all commits
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 |
---|---|---|
|
@@ -629,12 +629,20 @@ class SQLQuerySuite extends QueryTest { | |
.queryExecution.analyzed | ||
} | ||
|
||
test("test script transform") { | ||
test("test script transform for stdout") { | ||
val data = (1 to 100000).map { i => (i, i, i) } | ||
data.toDF("d1", "d2", "d3").registerTempTable("script_trans") | ||
assert(100000 === | ||
sql("SELECT TRANSFORM (d1, d2, d3) USING 'cat' AS (a,b,c) FROM script_trans") | ||
.queryExecution.toRdd.count()) | ||
.queryExecution.toRdd.count()) | ||
} | ||
|
||
test("test script transform for stderr") { | ||
val data = (1 to 100000).map { i => (i, i, i) } | ||
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. This test will flush the stderr while testing, should we generate less data or hide it someway? 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. Agree. Filed SPARK-8508 and PR #6925 to shrink unnecessary output. |
||
data.toDF("d1", "d2", "d3").registerTempTable("script_trans") | ||
assert(0 === | ||
sql("SELECT TRANSFORM (d1, d2, d3) USING 'cat 1>&2' AS (a,b,c) FROM script_trans") | ||
.queryExecution.toRdd.count()) | ||
} | ||
|
||
test("window function: udaf with aggregate expressin") { | ||
|
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.
Can you add a comment explaining why this is needed?
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.
builder.redirectError(Redirect.INHERIT)
would consuming the error output from buffer and then print it to stderr (inherit the target from the current Scala process).If without this there would be 2 issues:
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.
Put the comment in the source code.