You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Alessandro Solimando (Jira)" <ji...@apache.org> on 2025/08/08 07:50:00 UTC

[jira] [Commented] (CALCITE-7129) Drop @RuleConfig annotation used in Quidem tests

    [ https://issues.apache.org/jira/browse/CALCITE-7129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18012791#comment-18012791 ] 

Alessandro Solimando commented on CALCITE-7129:
-----------------------------------------------

I have rushed to open the ticket to not forget, but you are spot on as always, Stamatis!

Checking quickly it indeed seems possible to remove the annotation and simplify the code, I have opened a PR, thanks a lot for your suggestion!

> Drop @RuleConfig annotation used in Quidem tests
> ------------------------------------------------
>
>                 Key: CALCITE-7129
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7129
>             Project: Calcite
>          Issue Type: Improvement
>          Components: tests
>    Affects Versions: 1.40.0
>            Reporter: Alessandro Solimando
>            Priority: Major
>              Labels: pull-request-available
>
> In the context of CALCITE-7125, I have introduced a variant of [IntersectToDistinctRule|https://github.com/apache/calcite/blob/4fa0d5bbe987c4ae0779ca434fb71e1ae8637b77/core/src/main/java/org/apache/calcite/rel/rules/IntersectToDistinctRule.java] with a non-default configuration.
> When trying to use the rule with the new instructions for iq tests introduced in CALCITE-6335 (and refined in CALCITE-6998 to support rules with multiple configurations), the default configuration was being picked up, _CoreRules.INTERSECT_TO_DISTINCT_ instead of that of _CoreRules.INTERSECT_TO_DISTINCT_NO_AGGREGATE_PUSHDOWN_, and it took me a while to realize what was happening.
> Basically, I forgot to add the "@RuleConfig" annotation to the non-standard configuration of _CoreRules.INTERSECT_TO_DISTINCT_NO_AGGREGATE_PUSHDOWN_, and the test was silently using that of _CoreRules.INTERSECT_TO_DISTINCT_ instead, I noticed only because I was specifically looking at plan differences between the two.
> Not sure it's doable easily, but ideally we should have a check somewhere that is throwing an error if multiple variants of the same rule are present, and the non-default configuration lacks the required annotation.
> I am not sure, but more rules currently used might suffer from this problem.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)