xzj7019 commented on code in PR #24630:
URL: https://github.com/apache/doris/pull/24630#discussion_r1332597512
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/SubExprAnalyzer.java:
##########
@@ -72,7 +73,13 @@ public Expression visitNot(Not not, CascadesContext context)
{
@Override
public Expression visitExistsSubquery(Exists exists, CascadesContext
context) {
AnalyzedResult analyzedResult = analyzeSubquery(exists);
-
+ if (analyzedResult.rootIsLimitZero()) {
+ return BooleanLiteral.of(exists.isNot());
+ }
+ if (analyzedResult.isCorrelated() &&
analyzedResult.rootIsLimitWithOffset()) {
+ throw new AnalysisException("Unsupported correlated subquery with
a LIMIT clause with offset > 0 "
Review Comment:
select * from t1 where not exists (select * from t2 where t1.c1 = t2.c1
limit 0 offset 1);
Means doris will throw exception ? I think it makes sence to return full set
of t1.
and for exists, it returns empty sets also.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]