You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "LakeShen (Jira)" <ji...@apache.org> on 2023/10/08 04:04:00 UTC
[jira] [Updated] (CALCITE-5936) Refactor: Move the Enumerable tester method to EnumerableTestBase
[ https://issues.apache.org/jira/browse/CALCITE-5936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
LakeShen updated CALCITE-5936:
------------------------------
Fix Version/s: (was: 1.36.0)
> Refactor: Move the Enumerable tester method to EnumerableTestBase
> -----------------------------------------------------------------
>
> Key: CALCITE-5936
> URL: https://issues.apache.org/jira/browse/CALCITE-5936
> Project: Calcite
> Issue Type: Improvement
> Reporter: LakeShen
> Priority: Major
>
> In Calcite, there are classes called EnumerablexxxTest that test the logic of the underlying implementation of EnumerableRel, such as EnumerableCorrelateTest.
> But I found that almost every EnumerablexxxTest class has a tester method that builds CalciteAssert.AssertThat, Such as in EnumerableCorrelateTest, EnumerableSortedAggregateTest, EnumerableJoinTest, EnumerableBatchNestedLoopJoinTest class, they both have a tester method and the code is the same.
> {code:java}
> private CalciteAssert.AssertThat tester(boolean forceDecorrelate,
> Object schema) {
> return CalciteAssert.that()
> .with(CalciteConnectionProperty.LEX, Lex.JAVA)
> .with(CalciteConnectionProperty.FORCE_DECORRELATE, forceDecorrelate)
> .withSchema("s", new ReflectiveSchema(schema));
> } {code}
> In other EnumerablexxxTest classes, such as EnumerableMergeUnionTest,there is also a lot of repetition of the code above
> This duplication of code makes Calcite look bloated.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)