GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/16701
[SPARK-18909][SQL] The error messages in `ExpressionEncoder.toRow/fromRow`
are too verbose
## What changes were proposed in this pull request?
In `ExpressionEncoder.toRow` and `fromRow`, we will catch the exception and
put the treeString of serializer/deserializer expressions in the error message.
However, encoder can be very complex and the serializer/deserializer
expressions can be very large trees and blow up the log files(e.g. generate
over 500mb logs for this single error message.) We should simplify it.
**BEFORE**
```
scala> :paste
// Entering paste mode (ctrl-D to finish)
case class TestCaseClass(value: Int)
import spark.implicits._
Seq(TestCaseClass(1)).toDS().collect()
// Exiting paste mode, now interpreting.
java.lang.RuntimeException: Error while decoding:
java.lang.NullPointerException
newInstance(class TestCaseClass)
+- assertnotnull(input[0, int, false], - field (class: "scala.Int", name:
"value"), - root class: "TestCaseClass")
+- input[0, int, false]
at
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder.fromRow(ExpressionEncoder.scala:303)
...
```
**AFTER**
```
...
// Exiting paste mode, now interpreting.
java.lang.RuntimeException: Error while decoding:
java.lang.NullPointerException
newInstance(class TestCaseClass)
at
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder.fromRow(ExpressionEncoder.scala:303)
...
```
## How was this patch tested?
Manual.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-18909-EXPR-ERROR
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16701.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16701
----
commit 207a7472837e8110bdfa1a7b4b0e66a75ce29d73
Author: Dongjoon Hyun <[email protected]>
Date: 2017-01-25T09:27:26Z
[SPARK-18909][SQL] The error messages in `ExpressionEncoder.toRow/fromRow`
are too verbose
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]