-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-26103][SQL] Limit the length of debug strings for query plans #23169
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 1 commit
22bd4bd
b7f964d
3f4fe1f
30e4348
5528ca1
3171cf3
3ffdc6a
45a60fc
9678799
a5af842
a4be985
f0f75c2
1b692a0
22fe117
be3f265
f6d0efc
855f540
e83f5f2
db663b7
2eecbfa
4082aa3
f9085e7
b3d43b7
e470ab2
35bc1d5
5ec58c8
bdfaf28
0cfcb4e
eb69888
daf02f2
7d89388
4f56e48
a090fbb
dcb4eb0
b4cb7bf
4fec590
db0db18
b5b30f3
e4afa26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,8 @@ package org.apache.spark.sql.catalyst.util | |
|
|
||
| import java.io.Writer | ||
|
|
||
| class WriterSizeException(val attemptedSize: Long, val charLimit: Long) extends Exception( | ||
| s"Attempted to write $attemptedSize characters to a writer that is limited to $charLimit") | ||
| class WriterSizeException(val extraChars: Long, val charLimit: Long) extends Exception( | ||
| s"Writer reached limit of $charLimit characters. $extraChars extra characters ignored.") | ||
|
|
||
| /** | ||
| * This class is used to control the size of generated writers. Guarantees that the total number | ||
|
|
@@ -31,15 +31,15 @@ class WriterSizeException(val attemptedSize: Long, val charLimit: Long) extends | |
| */ | ||
| class SizeLimitedWriter(underlying: Writer, charLimit: Long) extends Writer { | ||
DaveDeCaprio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| var charsWritten: Long = 0 | ||
| private var charsWritten: Long = 0 | ||
|
|
||
| override def write(cbuf: Array[Char], off: Int, len: Int): Unit = { | ||
DaveDeCaprio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| val newLength = charsWritten + Math.min(cbuf.length - off, len) | ||
| if (newLength > charLimit) { | ||
| throw new WriterSizeException(newLength, charLimit) | ||
| val charsToWrite = Math.min(charLimit - charsWritten, len).toInt | ||
| underlying.write(cbuf, off, charsToWrite) | ||
| charsWritten += charsToWrite | ||
|
||
| if (charsToWrite < len) { | ||
| throw new WriterSizeException(len - charsToWrite, charLimit) | ||
DaveDeCaprio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| charsWritten = newLength | ||
| underlying.write(cbuf, off, len) | ||
| } | ||
|
|
||
| override def flush(): Unit = underlying.flush() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.