[fix](Nereids) throw readable exception when meet unsupport sup-query (#29147)

This commit is contained in:
morrySnow
2023-12-28 13:26:09 +08:00
committed by GitHub
parent fd90c3a6a6
commit bc08535285

View File

@ -163,8 +163,10 @@ public class Utils {
List<Expression> correlatedSlots) {
List<Expression> slots = new ArrayList<>();
correlatedPredicates.forEach(predicate -> {
if (!(predicate instanceof BinaryExpression) && !(predicate instanceof Not)) {
throw new AnalysisException("UnSupported expr type: " + correlatedPredicates);
if (!(predicate instanceof BinaryExpression)
&& (!(predicate instanceof Not) || !(predicate.child(0) instanceof BinaryExpression))) {
throw new AnalysisException("Unsupported correlated subquery with"
+ " non-equals correlated predicate " + predicate.toSql());
}
BinaryExpression binaryExpression;