Skip to content

Commit

Permalink
Fix incorrect RegExpReplace children handling on Spark 3.1+ (#2218)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Lowe <[email protected]>
  • Loading branch information
jlowe authored Apr 21, 2021
1 parent d01f283 commit 20e2c05
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,11 @@ class Spark311Shims extends Spark301Shims {
}
}
override def convertToGpu(): GpuExpression = {
val Seq(child0, child1, child2) = childExprs.map(_.convertToGpu())
GpuStringReplace(child0, child1, child2)
// ignore the pos expression which must be a literal 1 after tagging check
require(childExprs.length == 4,
s"Unexpected child count for RegExpReplace: ${childExprs.length}")
val Seq(subject, regexp, rep) = childExprs.take(3).map(_.convertToGpu())
GpuStringReplace(subject, regexp, rep)
}
}),
// Spark 3.1.1-specific LEAD expression, using custom OffsetWindowFunctionMeta.
Expand Down

0 comments on commit 20e2c05

Please sign in to comment.