You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2015/07/20 03:02:04 UTC

[jira] [Updated] (SPARK-8891) Calling aggregation expressions on null literals fails at runtime

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

Reynold Xin updated SPARK-8891:
-------------------------------
    Priority: Blocker  (was: Minor)

> Calling aggregation expressions on null literals fails at runtime
> -----------------------------------------------------------------
>
>                 Key: SPARK-8891
>                 URL: https://issues.apache.org/jira/browse/SPARK-8891
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.3.1, 1.4.0, 1.4.1, 1.5.0
>            Reporter: Josh Rosen
>            Assignee: Josh Rosen
>            Priority: Blocker
>
> Queries that call aggregate expressions with null literals, such as {{select avg(null)}} or {{select sum(null)}} fail with various errors due to mishandling of the internal NullType type.
> For instance, with codegen disabled on a recent 1.5 master:
> {code}
> scala.MatchError: NullType (of class org.apache.spark.sql.types.NullType$)
> 	at org.apache.spark.sql.catalyst.expressions.Cast.org$apache$spark$sql$catalyst$expressions$Cast$$cast(Cast.scala:407)
> 	at org.apache.spark.sql.catalyst.expressions.Cast.cast$lzycompute(Cast.scala:426)
> 	at org.apache.spark.sql.catalyst.expressions.Cast.cast(Cast.scala:426)
> 	at org.apache.spark.sql.catalyst.expressions.Cast.nullSafeEval(Cast.scala:428)
> 	at org.apache.spark.sql.catalyst.expressions.UnaryExpression.eval(Expression.scala:196)
> 	at org.apache.spark.sql.catalyst.expressions.Coalesce.eval(nullFunctions.scala:48)
> 	at org.apache.spark.sql.catalyst.expressions.BinaryExpression.eval(Expression.scala:268)
> 	at org.apache.spark.sql.catalyst.expressions.Coalesce.eval(nullFunctions.scala:48)
> 	at org.apache.spark.sql.catalyst.expressions.MutableLiteral.update(literals.scala:147)
> 	at org.apache.spark.sql.catalyst.expressions.SumFunction.update(aggregates.scala:536)
> 	at org.apache.spark.sql.execution.Aggregate$$anonfun$doExecute$1$$anonfun$6.apply(Aggregate.scala:132)
> 	at org.apache.spark.sql.execution.Aggregate$$anonfun$doExecute$1$$anonfun$6.apply(Aggregate.scala:125)
> 	at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:686)
> 	at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$17.apply(RDD.scala:686)
> 	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> 	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:277)
> 	at org.apache.spark.rdd.RDD.iterator(RDD.scala:244)
> 	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> 	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:277)
> 	at org.apache.spark.rdd.RDD.iterator(RDD.scala:244)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:70)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> 	at org.apache.spark.scheduler.Task.run(Task.scala:70)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:213)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> {code}
> When codegen is enabled, the resulting code fails to compile.
> The fix for this issue involves changes to Cast and Sum.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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