Uh oh!
There was an error while loading. Please reload this page.
[SPARK-26103][SQL] Limit the length of debug strings for query plans - #23169
[SPARK-26103][SQL] Limit the length of debug strings for query plans#23169DaveDeCaprio wants to merge 39 commits into
Conversation
DaveDeCaprio
commented
Nov 28, 2018
@MaxGekk and @hvanhovell, this is an alternative solution for #23076. It limits overall plan length when generating the full string in memory, but not if a specific writer is passed in. |
gatorsmile
commented
Nov 28, 2018
ok to test |
SparkQA
commented
Nov 28, 2018
Test build #99410 has finished for PR 23169 at commit
|
SparkQA
commented
Nov 28, 2018
Test build #99414 has finished for PR 23169 at commit
|
HeartSaVioR
left a comment
There was a problem hiding this comment.
Thanks for your effort on addressing this!
Would this patch address the issue on UI side too, or it will be addressed in another PR?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Nov 29, 2018
Test build #99418 has finished for PR 23169 at commit
|
SparkQA
commented
Nov 29, 2018
Test build #99426 has finished for PR 23169 at commit
|
Added the limit in for query execution
SparkQA
commented
Nov 29, 2018
Test build #99427 has finished for PR 23169 at commit
|
DaveDeCaprio
commented
Nov 29, 2018
I added changes to QueryExecution in the latest commit to address the UI issue. |
SparkQA
commented
Nov 29, 2018
Test build #99430 has finished for PR 23169 at commit
|
felixcheung
left a comment
There was a problem hiding this comment.
I didn't follow on all the long discussion, but I"m worry that having max len by default and blindly truncating plan string will break some of our important use cases that requires the full plan string?
DaveDeCaprio
commented
Nov 29, 2018
If you have an idea of what those use cases are I could take a look and see if there is an impact. If not, we could turn it off by default (set the max length to Long.Max). |
…t is specifically configured.
…an-size # Conflicts: # sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
Ok @felixcheung , I've updated this PR so that the default behavior does not change - full plan strings are always printed. |
SparkQA
commented
Dec 4, 2018
Test build #99632 has finished for PR 23169 at commit
|
SparkQA
commented
Dec 4, 2018
Test build #99631 has finished for PR 23169 at commit
|
HeartSaVioR
commented
Dec 4, 2018
retest this, please |
HeartSaVioR
commented
Dec 4, 2018
You might miss to roll back change in test. I also think you need to add a new test with setting configuration to some value and see whether it works properly. |
vanzin
left a comment
There was a problem hiding this comment.
@hvanhovell@MaxGekk if you don't comment here I'll assume you're ok with the changes.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MaxGekk
commented
Mar 6, 2019
I think we should indicate to users that a plan was cut otherwise the truncated plan can confuse them. For example, |
DaveDeCaprio
commented
Mar 8, 2019
I've removed the check that only prints the warning once, and added an indicator to the end of the truncated string saying how much has been removed. I decided to enforce that the plan string would always be within the limit, even counting the message at the end saying it was truncated. This was a bit of extra code but I think is more the behavior people would expect. |
SparkQA
commented
Mar 8, 2019
Test build #103222 has finished for PR 23169 at commit
|
SparkQA
commented
Mar 8, 2019
Test build #103223 has finished for PR 23169 at commit
|
SparkQA
commented
Mar 9, 2019
Test build #103231 has finished for PR 23169 at commit
|
SparkQA
commented
Mar 9, 2019
Test build #103268 has finished for PR 23169 at commit
|
vanzin
left a comment
There was a problem hiding this comment.
Just style issues. We generally prefer using === and !== in tests.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Mar 11, 2019
Test build #103346 has finished for PR 23169 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Mar 13, 2019
Test build #103402 has finished for PR 23169 at commit
|
vanzin
commented
Mar 13, 2019
Merging to master. |
…nfig key. ## What changes were proposed in this pull request? This is a follow-up of #23169. We should've used string-interpolation to show the config key in the warn message. ## How was this patch tested? Existing tests. Closes#24217 from ueshin/issues/SPARK-26103/s. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
tooptoop4
commented
Sep 10, 2019
@DaveDeCaprio@vanzin PR says merged but jira is open? |
HeartSaVioR
commented
Sep 11, 2019
@tooptoop4SPARK-26103 has been marked as resolved. Looks like you're referring to SPARK-25380 - SPARK-26103 would help for SPARK-25380 but the issue is not identical (SPARK-25380 concerns there're so many generated plans stored in memory). |
The PR puts in a limit on the size of a debug string generated for a tree node. Helps to fix out of memory errors when large plans have huge debug strings. In addition to SPARK-26103, this should also address SPARK-23904 and SPARK-25380. AN alternative solution was proposed in apache#23076, but that solution doesn't address all the cases that can cause a large query. This limit is only on calls treeString that don't pass a Writer, which makes it play nicely with apache#22429, apache#23018 and apache#23039. Full plans can be written to files, but truncated plans will be used when strings are held in memory, such as for the UI. - A new configuration parameter called spark.sql.debug.maxPlanLength was added to control the length of the plans. - When plans are truncated, "..." is printed to indicate that it isn't a full plan - A warning is printed out the first time a truncated plan is displayed. The warning explains what happened and how to adjust the limit. Unit tests were created for the new SizeLimitedWriter. Also a unit test for TreeNode was created that checks that a long plan is correctly truncated. Closesapache#23169 from DaveDeCaprio/text-plan-size. Lead-authored-by: Dave DeCaprio <daved@alum.mit.edu> Co-authored-by: David DeCaprio <daved@alum.mit.edu> Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
What changes were proposed in this pull request?
The PR puts in a limit on the size of a debug string generated for a tree node. Helps to fix out of memory errors when large plans have huge debug strings. In addition to SPARK-26103, this should also address SPARK-23904 and SPARK-25380. AN alternative solution was proposed in #23076, but that solution doesn't address all the cases that can cause a large query. This limit is only on calls treeString that don't pass a Writer, which makes it play nicely with #22429, #23018 and #23039. Full plans can be written to files, but truncated plans will be used when strings are held in memory, such as for the UI.
How was this patch tested?
Unit tests were created for the new SizeLimitedWriter. Also a unit test for TreeNode was created that checks that a long plan is correctly truncated.