-
- Downloads
[SPARK-17884][SQL] To resolve Null pointer exception when casting from empty...
[SPARK-17884][SQL] To resolve Null pointer exception when casting from empty string to interval type. ## What changes were proposed in this pull request? This change adds a check in castToInterval method of Cast expression , such that if converted value is null , then isNull variable should be set to true. Earlier, the expression Cast(Literal(), CalendarIntervalType) was throwing NullPointerException because of the above mentioned reason. ## How was this patch tested? Added test case in CastSuite.scala jira entry for detail: https://issues.apache.org/jira/browse/SPARK-17884 Author: prigarg <prigarg@adobe.com> Closes #15449 from priyankagargnitk/SPARK-17884.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala 6 additions, 1 deletion...cala/org/apache/spark/sql/catalyst/expressions/Cast.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala 1 addition, 0 deletions...org/apache/spark/sql/catalyst/expressions/CastSuite.scala
Loading
Please register or sign in to comment