You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "mihaibudiu (via GitHub)" <gi...@apache.org> on 2025/11/14 21:16:07 UTC
[PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
mihaibudiu opened a new pull request, #4634:
URL: https://github.com/apache/calcite/pull/4634
With many thanks to @zabetak who helped create the test case.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3537269694
You mean `simplifyComparisonWithNull`?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #4634:
URL: https://github.com/apache/calcite/pull/4634
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3534969488
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4634) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4634&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4634&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4634&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4634&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4634&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4634)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3577982087
I guess I forgot to merge this.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on code in PR #4634:
URL: https://github.com/apache/calcite/pull/4634#discussion_r2529883159
##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -1930,8 +1930,13 @@ public RelBuilder filter(Iterable<CorrelationId> variablesSet,
if (config.simplify()) {
conjunctionPredicates = simplifier.simplifyFilterPredicates(predicates);
} else {
+ List<RexNode> simplified = new ArrayList<>();
+ for (RexNode predicate : predicates) {
+ RexNode simple = RexSimplify.simplifyComparisonWithNull(predicate, getRexBuilder());
Review Comment:
When `config.simplify()` returns false, `simplifyComparisonWithNull` is still called. Does `simplifyComparisonWithNull` count as a simplification process? If it does, the logic seems very odd. If it doesn't, it appears that `simplifyComparisonWithNull` might return `False` under certain conditions. Additionally, a List variable named "simplified" is created here, which doesn't seem easy to understand.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3534693291
## [](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4634) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4634&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_calcite&pullRequest=4634&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_calcite&pullRequest=4634&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [100.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4634&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_calcite&pullRequest=4634&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_calcite&pullRequest=4634)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4634:
URL: https://github.com/apache/calcite/pull/4634#discussion_r2529707481
##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -1930,8 +1930,13 @@ public RelBuilder filter(Iterable<CorrelationId> variablesSet,
if (config.simplify()) {
conjunctionPredicates = simplifier.simplifyFilterPredicates(predicates);
} else {
+ List<RexNode> simplified = new ArrayList<>();
Review Comment:
predicates is an iterable, so you don't gain much, since you may need to traverse it twice
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #4634:
URL: https://github.com/apache/calcite/pull/4634#discussion_r2529539513
##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -1930,8 +1930,13 @@ public RelBuilder filter(Iterable<CorrelationId> variablesSet,
if (config.simplify()) {
conjunctionPredicates = simplifier.simplifyFilterPredicates(predicates);
} else {
+ List<RexNode> simplified = new ArrayList<>();
Review Comment:
minor improvement here:
```List<RexNode> simplified = new ArrayList<>(predicates.size);```
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #4634:
URL: https://github.com/apache/calcite/pull/4634#discussion_r2530082471
##########
core/src/main/java/org/apache/calcite/tools/RelBuilder.java:
##########
@@ -1930,8 +1930,13 @@ public RelBuilder filter(Iterable<CorrelationId> variablesSet,
if (config.simplify()) {
conjunctionPredicates = simplifier.simplifyFilterPredicates(predicates);
} else {
+ List<RexNode> simplified = new ArrayList<>();
+ for (RexNode predicate : predicates) {
+ RexNode simple = RexSimplify.simplifyComparisonWithNull(predicate, getRexBuilder());
Review Comment:
yes, this is a problem with all the PRs for [CALCITE-7070]. Julian suggested that there should exist no predicates that compare with null, at least when the pullUpPredicates is invoked, so someone has to take care to remove them on every code path where they get created. Refer to the JIRA discussion. I preferred the previous solution, which was shorter, which did allow such predicates to show up.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3537269947
That was not introduced in this PR anyway.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [CALCITE-7289] Select NULL subquery throwing exception [calcite]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on PR #4634:
URL: https://github.com/apache/calcite/pull/4634#issuecomment-3537287393
> That was not introduced in this PR anyway.
Indeed, this method name wasn’t introduced in this PR. The name “simplified” slightly hindered my understanding when I first saw this PR.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org