[CALCITE-5486] SubQuery not support HAVING alias in where condition#3053
[CALCITE-5486] SubQuery not support HAVING alias in where condition#3053JiajunBernoulli wants to merge 3 commits intoapache:mainfrom
Conversation
| @Override public @Nullable SqlNode visit(SqlCall call) { | ||
| call.getOperandList() | ||
| .stream() | ||
| .filter(node -> node != null) |
There was a problem hiding this comment.
node -> node != null -> Objects::nonNull seems better, WDYT?
There was a problem hiding this comment.
Good advice.
| /** Test case for | ||
| * <a href="https://issues.apache.org/jira/browse/CALCITE-5486">[CALCITE-5486] | ||
| * SubQuery not support HAVING alias in where condition</a>. */ | ||
| @Test void testHavingAliasInCondition() { |
There was a problem hiding this comment.
Should we also add a test in SqlToRelConverterTest to ensure we get the right plan?
|
LGTM |
| .forEach(node -> node.accept(this)); | ||
| if (call.getKind() == SqlKind.SELECT) { | ||
| SqlSelect select = (SqlSelect) call; | ||
| validateHavingClause(select); |
There was a problem hiding this comment.
validateWhereOrOn is used not only to validate where clause, is your change also applies to on clause, is there any test covers this?
There was a problem hiding this comment.
Thanks for your review, I added one test.
|
Kudos, SonarCloud Quality Gate passed! |
|
@JiajunBernoulli I've left some comments in the jira, and marked this PR "discussion in jira" label. |
8a5cf83 to
cf7f71b
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions. |








No description provided.