spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-8428) TimSort Comparison method violates its general contract with CLUSTER BY
Date Thu, 26 May 2016 20:49:13 GMT

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

Apache Spark reassigned SPARK-8428:
-----------------------------------

    Assignee: Apache Spark

> TimSort Comparison method violates its general contract with CLUSTER BY
> -----------------------------------------------------------------------
>
>                 Key: SPARK-8428
>                 URL: https://issues.apache.org/jira/browse/SPARK-8428
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.4.0
>         Environment: Oracle Java 7 
>            Reporter: Nathan McCarthy
>            Assignee: Apache Spark
>
> Running an SQL query that has a sub query and multiple left joins fails when there is
a CLUSTER BY (which implies a sortBy). This gives the following stack trace; 
> {code}
> Job aborted due to stage failure: Task 118 in stage 4.0 failed 4 times, most recent failure:
Lost task 118.3 in stage 4.0 (TID 18392, node142): java.lang.IllegalArgumentException: Comparison
method violates its general contract!
> 	at org.apache.spark.util.collection.TimSort$SortState.mergeHi(TimSort.java:900)
> 	at org.apache.spark.util.collection.TimSort$SortState.mergeAt(TimSort.java:509)
> 	at org.apache.spark.util.collection.TimSort$SortState.mergeCollapse(TimSort.java:435)
> 	at org.apache.spark.util.collection.TimSort$SortState.access$200(TimSort.java:307)
> 	at org.apache.spark.util.collection.TimSort.sort(TimSort.java:135)
> 	at org.apache.spark.util.collection.Sorter.sort(Sorter.scala:37)
> 	at org.apache.spark.util.collection.PartitionedPairBuffer.partitionedDestructiveSortedIterator(PartitionedPairBuffer.scala:70)
> 	at org.apache.spark.util.collection.ExternalSorter.partitionedIterator(ExternalSorter.scala:690)
> 	at org.apache.spark.util.collection.ExternalSorter.iterator(ExternalSorter.scala:708)
> 	at org.apache.spark.sql.execution.ExternalSort$$anonfun$doExecute$6$$anonfun$apply$7.apply(basicOperators.scala:222)
> 	at org.apache.spark.sql.execution.ExternalSort$$anonfun$doExecute$6$$anonfun$apply$7.apply(basicOperators.scala:218)
> 	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.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.ResultTask.runTask(ResultTask.scala:63)
> 	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)
> Driver stacktrace:
> {code}
> The query looks like;
> {code}
>  val df = sqlContext.sql("""SELECT CID
> |,	PW_END_DATE
> |,	PROD_NBR_KEY
> |,	SUM(CASE WHEN SUBST_IDX = 1 THEN L13W_SALE END) AS SUB1_L13W_SALE
> |FROM
> |(SELECT	BASE.CID
> |,	BASE.PW_END_DATE
> |,	BASE.PROD_NBR_KEY
> |,	SUBN.SUBST_IDX
> |,	CASE WHEN IDX.PW_END_DATE BETWEEN DATE_SUB(BASE.PW_END_DATE, 13*7 - 1) AND BASE.PW_END_DATE
THEN IDX.TOT_AMT_INCLD_GST END AS L13W_SALE
> |FROM TESTBASE BASE
> |LEFT JOIN TABLX SUBN
> |ON BASE.PROD_NBR_KEY = SUBN.PROD_NBR_KEY AND SUBN.SUBST_IDX <= 3
> |LEFT JOIN TABLEF IDX
> |ON BASE.CRN = IDX.CRN
> |AND SUBN.CROSS_PROD_NBR = IDX.PROD_NBR_KEY
> |) SUBSPREM
> | GROUP BY CRN, PW_END_DATE, PROD_NBR_KEY""".stripMargin)
> {code}



--
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


Mime
View raw message