From ff54eb51067330cabb7647112e29bc7e7b7c299d Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sun, 13 Mar 2016 14:36:14 +0000 Subject: [PATCH] Defer the variable evaluation for Limit codegen. --- .../src/main/scala/org/apache/spark/sql/execution/limit.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala index ca624a5a84e6c..b4f4222631b78 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/limit.scala @@ -65,6 +65,8 @@ trait BaseLimit extends UnaryNode with CodegenSupport { child.asInstanceOf[CodegenSupport].produce(ctx, this) } + override def usedInputs: AttributeSet = AttributeSet.empty + override def doConsume(ctx: CodegenContext, input: Seq[ExprCode], row: String): String = { val stopEarly = ctx.freshName("stopEarly") ctx.addMutableState("boolean", stopEarly, s"$stopEarly = false;")