Skip to content

Commit

Permalink
[VL] Remove a workaround fix for ignoreNulls of lead/lag function (#5084
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ulysses-you authored Mar 22, 2024
1 parent 63e83bd commit dafb371
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,6 @@ trait SparkPlanExecApi {
attributeSeq = originalInputAttributes)
.doTransform(args))
}
val ignoreNulls = if (offset == 0) {
// This is a workaround for Velox backend, because velox has bug if the
// ignoreNulls is true and offset is 0.
// Logically, if offset is 0 the ignoreNulls is always meaningless, so
// this workaround is safe.
// TODO, remove this once Velox has fixed it
false
} else {
offsetWf.ignoreNulls
}
val windowFunctionNode = ExpressionBuilder.makeWindowFunction(
WindowFunctionsBuilder.create(args, offsetWf).toInt,
childrenNodeList,
Expand All @@ -573,7 +563,7 @@ trait SparkPlanExecApi {
WindowExecTransformer.getFrameBound(frame.upper),
WindowExecTransformer.getFrameBound(frame.lower),
frame.frameType.sql,
ignoreNulls
offsetWf.ignoreNulls
)
windowExpressionNodes.add(windowFunctionNode)
case wf @ NthValue(input, offset: Literal, ignoreNulls: Boolean) =>
Expand Down

0 comments on commit dafb371

Please sign in to comment.