[GitHub] [calcite] libenchao commented on a diff in pull request #2929: [CALCITE-5310] JSON_OBJECT in scalar sub-query throws AssertionError
libenchao commented on code in PR #2929: URL: https://github.com/apache/calcite/pull/2929#discussion_r1022368836 ## core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java: ## @@ -1790,10 +1790,11 @@ private RexNode createCaseExpression( @Override public RexNode visitLiteral(RexLiteral literal) { // Use nullIndicator to decide whether to project null. - // Do nothing if the literal is null. + // Do nothing if the literal is null or symbol. if (!RexUtil.isNull(literal) Review Comment: @dssysolyatin Thanks for your review. It's good to have such questions and discussions. -- 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-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [calcite] libenchao commented on a diff in pull request #2929: [CALCITE-5310] JSON_OBJECT in scalar sub-query throws AssertionError
libenchao commented on code in PR #2929: URL: https://github.com/apache/calcite/pull/2929#discussion_r1022252807 ## core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java: ## @@ -1790,10 +1790,11 @@ private RexNode createCaseExpression( @Override public RexNode visitLiteral(RexLiteral literal) { // Use nullIndicator to decide whether to project null. - // Do nothing if the literal is null. + // Do nothing if the literal is null or symbol. if (!RexUtil.isNull(literal) Review Comment: The whole story lies in `RelDecorrelator#RemoveCorrelationRexShuttle`. When `projectPulledAboveLeftCorrelator && (nullIndicator != null)` is `true`, currently it will add a case for all expressions. Maybe your feeling is right, I haven't thought it thorough. -- 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-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [calcite] libenchao commented on a diff in pull request #2929: [CALCITE-5310] JSON_OBJECT in scalar sub-query throws AssertionError
libenchao commented on code in PR #2929: URL: https://github.com/apache/calcite/pull/2929#discussion_r1020832236 ## core/src/main/java/org/apache/calcite/sql2rel/RelDecorrelator.java: ## @@ -1790,10 +1790,11 @@ private RexNode createCaseExpression( @Override public RexNode visitLiteral(RexLiteral literal) { // Use nullIndicator to decide whether to project null. - // Do nothing if the literal is null. + // Do nothing if the literal is null or symbol. if (!RexUtil.isNull(literal) Review Comment: We are using `LEFT` join type for scalar sub-query decorrelating, see here: https://github.com/apache/calcite/blob/7277e53adea98e7dd8477d5a47e728aca6d8f680/core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java#L136. Hence, in this place, we'll wrap all expressions into case expression. -- 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-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org