You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "Aitozi (via GitHub)" <gi...@apache.org> on 2023/06/16 06:28:11 UTC

[GitHub] [calcite] Aitozi opened a new pull request, #3269: [CALCITE-5784] Generate the same correlationId for the same query

Aitozi opened a new pull request, #3269:
URL: https://github.com/apache/calcite/pull/3269

   Add a map to cache the correlarionId in the `SqlToRelConverter` to deduplicate correlationId for the same scope of identifier


-- 
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


[GitHub] [calcite] Aitozi commented on a diff in pull request #3269: [CALCITE-5784] Generate the same correlationId for the same query

Posted by "Aitozi (via GitHub)" <gi...@apache.org>.
Aitozi commented on code in PR #3269:
URL: https://github.com/apache/calcite/pull/3269#discussion_r1231891414


##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -277,6 +277,13 @@ public class SqlToRelConverter {
   private final Map<CorrelationId, DeferredLookup> mapCorrelToDeferred =
       new HashMap<>();
 
+  /**
+   * The scope and identifier to the correlationId to deduplicate the creation of the
+   * correlationId.
+   */
+  private final Map<Pair<SqlValidatorScope, String>, CorrelationId> correlationIdMap =

Review Comment:
   This map will rely on the object identifier of the scope, in the test case I posted, It can work well. But I'm not sure whether it's a good enough solution to reply on this object identifier here. 
   
   Looking forward to some suggestion, thanks.



-- 
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