Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
[NSE-984] fix concat_ws (#992)
Browse files Browse the repository at this point in the history
* fix concat_ws

Signed-off-by: Yuan Zhou <[email protected]>

* fix

Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan authored Jun 28, 2022
1 parent b973977 commit 3bef6d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ class ColumnarConcatWs(exps: Seq[Expression], original: Expression)
}

override def doColumnarCodeGen(args: java.lang.Object): (TreeNode, ArrowType) = {
if (exps.size == 2) {
// return 2nd param, ignore spliter
val (exp_node, expType): (TreeNode, ArrowType) =
exps.last.asInstanceOf[ColumnarExpression].doColumnarCodeGen(args)
return (exp_node, expType)
} else if (exps.size == 1) {
// Corner case, only spliter provided
return (TreeBuilder.makeNull(ArrowType.Utf8.INSTANCE), ArrowType.Utf8.INSTANCE)
}

val iter: Iterator[Expression] = exps.iterator
val exp = iter.next() // spliter
val exp1 = iter.next()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ object ColumnarExpressionConverter extends Logging {
return true
case c: Concat =>
c.children.map(containsSubquery).exists(_ == true)
case c: ConcatWs =>
c.children.map(containsSubquery).exists(_ == true)
case getArrayItem: GetArrayItem =>
getArrayItem.child match {
case strSplit: StringSplit =>
Expand Down

0 comments on commit 3bef6d4

Please sign in to comment.