From bfbb0be4cb7451cec24f9e6fe46f6955697c37cc Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Fri, 30 Aug 2024 11:34:17 -0700 Subject: [PATCH] fix: CometTakeOrderedAndProjectExec native scan node should use child operator's output (#896) --- .../spark/sql/comet/CometTakeOrderedAndProjectExec.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spark/src/main/scala/org/apache/spark/sql/comet/CometTakeOrderedAndProjectExec.scala b/spark/src/main/scala/org/apache/spark/sql/comet/CometTakeOrderedAndProjectExec.scala index a8e2a98db..ce40a2ebf 100644 --- a/spark/src/main/scala/org/apache/spark/sql/comet/CometTakeOrderedAndProjectExec.scala +++ b/spark/src/main/scala/org/apache/spark/sql/comet/CometTakeOrderedAndProjectExec.scala @@ -75,12 +75,12 @@ case class CometTakeOrderedAndProjectExec( childRDD } else { val localTopK = if (orderingSatisfies) { - CometExecUtils.getNativeLimitRDD(childRDD, output, limit) + CometExecUtils.getNativeLimitRDD(childRDD, child.output, limit) } else { childRDD.mapPartitionsInternal { iter => val topK = CometExecUtils - .getTopKNativePlan(output, sortOrder, child, limit) + .getTopKNativePlan(child.output, sortOrder, child, limit) .get CometExec.getCometIterator(Seq(iter), topK) } @@ -100,7 +100,7 @@ case class CometTakeOrderedAndProjectExec( singlePartitionRDD.mapPartitionsInternal { iter => val topKAndProjection = CometExecUtils - .getProjectionNativePlan(projectList, output, sortOrder, child, limit) + .getProjectionNativePlan(projectList, child.output, sortOrder, child, limit) .get val it = CometExec.getCometIterator(Seq(iter), topKAndProjection) setSubqueries(it.id, this)