-
- Downloads
[SPARK-11277][SQL] sort_array throws exception scala.MatchError
I'm new to spark. I was trying out the sort_array function then hit this exception. I looked into the spark source code. I found the root cause is that sort_array does not check for an array of NULLs. It's not meaningful to sort an array of entirely NULLs anyway. I'm adding a check on the input array type to SortArray. If the array consists of NULLs entirely, there is no need to sort such array. I have also added a test case for this. Please help to review my fix. Thanks! Author: Jia Li <jiali@us.ibm.com> Closes #9247 from jliwork/SPARK-11277.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala 5 additions, 1 deletion...spark/sql/catalyst/expressions/collectionOperations.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CollectionFunctionsSuite.scala 7 additions, 0 deletions...k/sql/catalyst/expressions/CollectionFunctionsSuite.scala
Please register or sign in to comment