java.lang.ArithmeticException: / by zero

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

java.lang.ArithmeticException: / by zero
at org.apache.spark.sql.sources.druid.DruidQueryCostModel$.computeMethod(DruidQueryCostModel.scala:528)
at org.apache.spark.sql.sources.druid.DruidQueryCostModel$.computeMethod(DruidQueryCostModel.scala:596)
at org.apache.spark.sql.sources.druid.DruidStrategy$$anonfun$1$$anonfun$apply$2.apply(DruidStrategy.scala:71)
at org.apache.spark.sql.sources.druid.DruidStrategy$$anonfun$1$$anonfun$apply$2.apply(DruidStrategy.scala:37)
at scala.Option.map(Option.scala:145)
at org.apache.spark.sql.sources.druid.DruidStrategy$$anonfun$1.apply(DruidStrategy.scala:37)
at org.apache.spark.sql.sources.druid.DruidStrategy$$anonfun$1.apply(DruidStrategy.scala:36)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:90)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:89)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3$$anonfun$apply$1.apply(GenTraversableViewLike.scala:91)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3$$anonfun$apply$1.apply(GenTraversableViewLike.scala:91)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:90)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:89)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3$$anonfun$apply$1.apply(GenTraversableViewLike.scala:91)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:90)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:89)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.SeqLike$$anon$2.foreach(SeqLike.scala:635)
at scala.collection.GenTraversableViewLike$FlatMapped$class.foreach(GenTraversableViewLike.scala:89)
at scala.collection.SeqViewLike$$anon$4.foreach(SeqViewLike.scala:79)
at scala.collection.GenTraversableViewLike$FlatMapped$class.foreach(GenTraversableViewLike.scala:89)
at scala.collection.SeqViewLike$$anon$4.foreach(SeqViewLike.scala:79)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:90)
at scala.collection.GenTraversableViewLike$FlatMapped$$anonfun$foreach$3.apply(GenTraversableViewLike.scala:89)
at scala.collection.Iterator$class.foreach(Iterator.scala:727)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.SeqLike$$anon$2.foreach(SeqLike.scala:635)
at scala.collection.GenTraversableViewLike$FlatMapped$class.foreach(GenTraversableViewLike.scala:89)
at scala.collection.SeqViewLike$$anon$4.foreach(SeqViewLike.scala:79)
at scala.collection.GenTraversableViewLike$FlatMapped$class.foreach(GenTraversableViewLike.scala:89)
at scala.collection.SeqViewLike$$anon$4.foreach(SeqViewLike.scala:79)
at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:176)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:45)
at scala.collection.TraversableLike$class.to(TraversableLike.scala:629)
at scala.collection.SeqViewLike$AbstractTransformed.to(SeqViewLike.scala:43)
at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:257)
at org.apache.spark.sql.sources.druid.DruidStrategy.apply(DruidStrategy.scala:119)
at org.apache.spark.sql.catalyst.planning.QueryPlanner$$anonfun$1.apply(QueryPlanner.scala:58)
at org.apache.spark.sql.execution.QueryExecution.sparkPlan$lzycompute(QueryExecution.scala:47)
at org.apache.spark.sql.execution.QueryExecution.sparkPlan(QueryExecution.scala:45)
at org.apache.spark.sql.execution.QueryExecution.executedPlan$lzycompute(QueryExecution.scala:52)
at org.apache.spark.sql.execution.QueryExecution.executedPlan(QueryExecution.scala:52)
at org.apache.spark.sql.DataFrame.withCallback(DataFrame.scala:2134)
at org.apache.spark.sql.DataFrame.org$apache$spark$sql$DataFrame$$collect(DataFrame.scala:1542)
at org.apache.spark.sql.DataFrame.collect(DataFrame.scala:1519)
at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.org$apache$spark$sql$hive$thriftserver$SparkExecuteStatementOperation$$execute(SparkExecuteStatementOperation.scala:226)
at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$1$$anon$2.run(SparkExecuteStatementOperation.scala:154)
at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$1$$anon$2.run(SparkExecuteStatementOperation.scala:151)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$1.run(SparkExecuteStatementOperation.scala:164)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.