-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-32827][SQL] Add spark.sql.maxMetadataStringLength config #29688
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
Conversation
|
Test build #128434 has finished for PR 29688 at commit
|
|
Test build #128435 has finished for PR 29688 at commit
|
|
@maropu @dongjoon-hyun @cloud-fan do you have time to look this ? thanks ! |
|
|
||
| val MAX_METADATA_STRING_LENGTH = buildConf("spark.sql.maxMetadataStringLength") | ||
| .doc("Maximum number of characters to output for a metadata string. e.g. " + | ||
| "`DataSourceScanExec`, every value will be abbreviated if exceed length.") |
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.
e.g. DataSourceScanExec => e.g. file location in DataSourceScanExec
|
|
||
| test("SPARK-32827: Add spark.sql.maxMetadataStringLength config") { | ||
| withTempDir { dir => | ||
| val tableName = "t1" |
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.
nit: t1 -> t
| val tableName = "t1" | ||
| val path = s"${dir.getCanonicalPath}/$tableName" | ||
| withTable(tableName) { | ||
| sql(s"create table t1(c int) using parquet location '$path'") |
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.
plz use uppercases for SQL keywords, e.g., CREATE TABLE
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.
done.
|
Adding the config looks okay to me. |
|
Test build #128444 has finished for PR 29688 at commit
|
|
Test build #128443 has finished for PR 29688 at commit
|
|
Glad to see this happening @ulysses-you ! We have a similar internal patch we added recently that we've been planning to open source. Nice to see that the changes are even simpler on the 3.x line. |
| } | ||
| } | ||
|
|
||
| test("SPARK-32827: Add spark.sql.maxMetadataStringLength config") { |
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.
Nit: Add spark.sql.maxMetadataStringLength config => Set max metadata string length
|
@ulysses-you thanks for the work. |
|
Thanks @gengliangwang .The origin propose is for explain test what I said in pr description, related pr is #29586. Location value has been abbreviated by I'm not sure if it's well to do these change in one pr. But I can merge them into one pr if you think it's ok. |
|
Test build #128596 has finished for PR 29688 at commit
|
|
Test build #128611 has finished for PR 29688 at commit
|
I will use this config in my pr #29739. |
|
thanks, merging to master! |
|
Thanks for merging, thanks all ! |
What changes were proposed in this pull request?
Add a new config
spark.sql.maxMetadataStringLength. This config aims to limit metadata value length, e.g. file location.Why are the changes needed?
Some metadata have been abbreviated by
...when I tried to add some test inSQLQueryTestSuite. We need to replace such value tonotIncludedMsg. That caused we can't replace that like location value byclassNamesince theclassNamehas been abbreviated.Here is a case:
Does this PR introduce any user-facing change?
No, a new config.
How was this patch tested?
new test.