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

[NSE-984] fix concat_ws #992

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PHILO-HE the logic has been moved here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

// 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