Github user MaxGekk commented on a diff in the pull request:
https://github.com/apache/spark/pull/22429#discussion_r221011834
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala ---
@@ -167,6 +170,56 @@ package object util {
builder.toString()
}
+ /**
+ * The performance overhead of creating and logging strings for wide
schemas can be large. To
+ * limit the impact, we bound the number of fields to include by
default. This can be overridden
+ * by setting the 'spark.debug.maxToStringFields' conf in SparkEnv.
+ */
+ val DEFAULT_MAX_TO_STRING_FIELDS = 25
+
+ private[spark] def maxNumToStringFields = {
+ if (SparkEnv.get != null) {
+ SparkEnv.get.conf.getInt("spark.debug.maxToStringFields",
DEFAULT_MAX_TO_STRING_FIELDS)
--- End diff --
I have added new SQL config and I am testing it for now. My concern is how
to combine old config, new config and passed parameter. I am going to take
maximum of them like:
```scala
private[spark] def maxNumToStringFields = {
val legacyLimit = if (SparkEnv.get != null) {
SparkEnv.get.conf.getInt("spark.debug.maxToStringFields",
DEFAULT_MAX_TO_STRING_FIELDS)
} else {
DEFAULT_MAX_TO_STRING_FIELDS
}
val sqlConfLimit = SQLConf.get.maxToStringFields
Math.max(sqlConfLimit, legacyLimit)
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]