From 3e2b59f808dcf2cd8aa6b0d55c1190bf06052bd4 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Tue, 6 Aug 2024 16:14:16 +0000 Subject: [PATCH] Revert "shared tries" This reverts commit 34651e70e51c64ac581ba6f3a3186453d6f575cf. --- .../druid/msq/quidem/MSQSharedQuidemTest.java | 37 ------------- .../druid/quidem/DruidQuidemTestBase.java | 15 ++---- .../apache/druid/quidem/SharedQuidemTest.java | 54 ------------------- .../apache/druid/sql/calcite/QTestCase.java | 2 +- .../shared.iq | 21 -------- 5 files changed, 4 insertions(+), 125 deletions(-) delete mode 100644 extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/quidem/MSQSharedQuidemTest.java delete mode 100644 sql/src/test/java/org/apache/druid/quidem/SharedQuidemTest.java delete mode 100644 sql/src/test/quidem/org.apache.druid.quidem.SharedQuidemTest/shared.iq diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/quidem/MSQSharedQuidemTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/quidem/MSQSharedQuidemTest.java deleted file mode 100644 index b125d23f2b0..00000000000 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/quidem/MSQSharedQuidemTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.msq.quidem; - -import org.apache.druid.quidem.SharedQuidemTest; - -public class MSQSharedQuidemTest extends SharedQuidemTest -{ - - public MSQSharedQuidemTest() - { - super(); - } - - @Override - protected boolean isNative() - { - return false; - } -} diff --git a/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java b/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java index 878af0181d2..544a547adc7 100644 --- a/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java +++ b/sql/src/test/java/org/apache/druid/quidem/DruidQuidemTestBase.java @@ -49,7 +49,6 @@ import java.io.Writer; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.function.Function; import static org.junit.jupiter.api.Assertions.fail; @@ -108,7 +107,7 @@ public abstract class DruidQuidemTestBase } filter = new WildcardFileFilter(filterStr); } - druidQuidemRunner = new DruidQuidemRunner(this::getEnv); + druidQuidemRunner = new DruidQuidemRunner(); } /** Creates a command handler. */ @@ -129,11 +128,8 @@ public abstract class DruidQuidemTestBase public static class DruidQuidemRunner { - private final Function envFunction; - - public DruidQuidemRunner(Function envFunction) + public DruidQuidemRunner() { - this.envFunction = envFunction; } public void run(File inFile) throws Exception @@ -153,7 +149,7 @@ public abstract class DruidQuidemTestBase ConfigBuilder configBuilder = Quidem.configBuilder() .withConnectionFactory(connectionFactory) .withPropertyHandler(connectionFactory) - .withEnv(envFunction) + .withEnv(connectionFactory::getEnv) .withCommandHandler(new DruidQuidemCommandHandler()); Config config = configBuilder @@ -220,9 +216,4 @@ public abstract class DruidQuidemTestBase { DruidAvaticaTestDriver.CONFIG_STORE.close(); } - - protected Object getEnv(String name) - { - return null; - } } diff --git a/sql/src/test/java/org/apache/druid/quidem/SharedQuidemTest.java b/sql/src/test/java/org/apache/druid/quidem/SharedQuidemTest.java deleted file mode 100644 index 41a77c30b93..00000000000 --- a/sql/src/test/java/org/apache/druid/quidem/SharedQuidemTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.druid.quidem; - -import java.io.File; - -public class SharedQuidemTest extends DruidQuidemTestBase -{ - public SharedQuidemTest() - { - super(); - } - - @Override - protected final File getTestRoot() - { - return ProjectPathUtils.getPathFromProjectRoot("sql/src/test/quidem/" + SharedQuidemTest.class.getName()); - } - - @Override - protected final Object getEnv(String name) - { - if (name.equals("isMSQ")) { - return !isNative(); - } - if (name.equals("isNative")) { - return isNative(); - } - return super.getEnv(name); - } - - protected boolean isNative() - { - return true; - } -} - diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/QTestCase.java b/sql/src/test/java/org/apache/druid/sql/calcite/QTestCase.java index 695024e00e2..67f5bf3c2eb 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/QTestCase.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/QTestCase.java @@ -69,7 +69,7 @@ public class QTestCase isValidTestCaseFile(testInfo.getIQFile()); } - DruidQuidemRunner runner = new DruidQuidemTestBase.DruidQuidemRunner(name -> null); + DruidQuidemRunner runner = new DruidQuidemTestBase.DruidQuidemRunner(); runner.run(testInfo.getIQFile()); } catch (Exception e) { diff --git a/sql/src/test/quidem/org.apache.druid.quidem.SharedQuidemTest/shared.iq b/sql/src/test/quidem/org.apache.druid.quidem.SharedQuidemTest/shared.iq deleted file mode 100644 index 65e012c2cd1..00000000000 --- a/sql/src/test/quidem/org.apache.druid.quidem.SharedQuidemTest/shared.iq +++ /dev/null @@ -1,21 +0,0 @@ -!set plannerStrategy DECOUPLED -isMSQ false -!show isMSQ - -!if (isMSQ) { -!use druidtest://?componentSupplier=DrillWindowQueryMSQComponentSupplier -!} -!if (isNative) { -!use druidtest://?numMergeBuffers=3 -!} - -select 1+1; - -!nativePlan - -!if (isMSQ) { -!msqPlan -!} - - -