Skip to content

Commit

Permalink
[Improvement](delete) cast delete binary predicate rhs type to lhs ty…
Browse files Browse the repository at this point in the history
…pe (apache#24321)

cast delete binary predicate rhs type to lhs type
  • Loading branch information
BiteTheDDDDt authored Sep 14, 2023
1 parent 268c867 commit 42ca0fc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ void analyzePredicate(Expr predicate, Analyzer analyzer) throws AnalysisExceptio
}
if (predicate instanceof BinaryPredicate) {
BinaryPredicate binaryPredicate = (BinaryPredicate) predicate;
binaryPredicate.getChild(0).analyze(analyzer);
binaryPredicate.getChild(1).analyze(analyzer);

binaryPredicate.setChild(1, binaryPredicate.getChild(1).castTo(binaryPredicate.getChild(0).getType()));
binaryPredicate.analyze(analyzer);

ExprRewriter exprRewriter = new ExprRewriter(FoldConstantsRule.INSTANCE);
binaryPredicate.setChild(1, exprRewriter.rewrite(binaryPredicate.getChild(1), analyzer, null));
Expr leftExpr = binaryPredicate.getChild(0);
Expand Down

0 comments on commit 42ca0fc

Please sign in to comment.