You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "StanZhai (JIRA)" <ji...@apache.org> on 2017/02/08 12:35:41 UTC

[jira] [Reopened] (SPARK-19509) [SQL]GROUPING SETS throws NullPointerException when use a CASE WHEN statement

     [ https://issues.apache.org/jira/browse/SPARK-19509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

StanZhai reopened SPARK-19509:
------------------------------

It doesn't look like the same problem.
I have tried to merge https://github.com/apache/spark/pull/15980 into branch-2.1.0. The problem still exist.

> [SQL]GROUPING SETS throws NullPointerException when use a CASE WHEN statement
> -----------------------------------------------------------------------------
>
>                 Key: SPARK-19509
>                 URL: https://issues.apache.org/jira/browse/SPARK-19509
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: StanZhai
>            Priority: Critical
>
> To reproduce the issue a CASE WHEN statement must be return a STRING value and the grouping sets must be empty.
> {code:sql|title=A simple case}
> select case "0" when "0" then "a" else "b" end
> from tb
> group by case "0" when "0" then "a" else "b" end
> grouping sets (())
> {code}
> {code:title=Exception}
> Caused by: java.lang.NullPointerException
> 	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.agg_doAggregateWithKeys$(Unknown Source)
> 	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source)
> 	at org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
> 	at org.apache.spark.sql.execution.WholeStageCodegenExec$$anonfun$8$$anon$1.hasNext(WholeStageCodegenExec.scala:377)
> 	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:408)
> 	at org.apache.spark.shuffle.sort.BypassMergeSortShuffleWriter.write(BypassMergeSortShuffleWriter.java:126)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
> 	at org.apache.spark.scheduler.Task.run(Task.scala:99)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org