Skip to content

Commit

Permalink
[SPARK-39857][SQL] V2ExpressionBuilder uses the wrong LiteralValue da…
Browse files Browse the repository at this point in the history
…ta type for In predicate (#535)

When building V2 `In` Predicate in `V2ExpressionBuilder`, `InSet.dataType` (which is `BooleanType`) is used to build the `LiteralValue`, `InSet.child.dataType` should be used instead.

bug fix

no

new test

Closes apache#37271 from huaxingao/inset.

Authored-by: huaxingao <huaxin_gao@apple.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>

Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Co-authored-by: huaxingao <huaxin_gao@apple.com>
  • Loading branch information
2 people authored and RolatZhang committed Aug 29, 2023
1 parent 640bf68 commit 7988c91
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class V2ExpressionBuilder(e: Expression, isPredicate: Boolean = false) {
} else {
Some(ref)
}
case in @ InSet(child, hset) =>
case InSet(child, hset) =>
generateExpression(child).map { v =>
val children =
(v +: hset.toSeq.map(elem => LiteralValue(elem, child.dataType))).toArray[V2Expression]
Expand Down

0 comments on commit 7988c91

Please sign in to comment.