viirya commented on issue #27117: [SPARK-30429][SQL] ValidateExternalType should not initiate errMsg in the constructor URL: https://github.com/apache/spark/pull/27117#issuecomment-571664120 > If we really need to output the error message for large `expected.catalogString`, it will fail with OOM, right? which is not good. To avoid such kind of issues, it would be nice to use `StringConcat`: > > https://github.com/apache/spark/blob/d9b30694122f8716d3acb448638ef1e2b96ebc7a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/StringUtils.scala#L102-L107 > > or truncate `expected.catalogString` somehow else. > > @viirya Or OOM happens because we create a lot of `ValidateExternalType.errMsg`? When we transform on the serializer, we copy expressions there, it creates redundant `ValidateExternalType.errMsg`s. So we initiates more than needed `errMsg` (of the transformed serializer) now. Currently the OOM at WideSchemaBenchmark is due to this. As we will initiate `errMsg` when we actually need to use `ValidateExternalType`. The current nested level at WideSchemaBenchmark is ok. But more deeply nested case might cause OOM possibly if it asks more memory. I think as you and @cloud-fan, we may need to truncate `expected.catalogString` in `ValidateExternalType` to prevent that.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
