forked from apache/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b31be6
commit 7e60702
Showing
10 changed files
with
757 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
...e/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteUnionQueryMSQTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* 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.test; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.google.inject.Injector; | ||
import com.google.inject.Module; | ||
import org.apache.druid.guice.DruidInjectorBuilder; | ||
import org.apache.druid.msq.exec.WorkerMemoryParameters; | ||
import org.apache.druid.msq.sql.MSQTaskSqlEngine; | ||
import org.apache.druid.query.groupby.TestGroupByBuffers; | ||
import org.apache.druid.server.QueryLifecycleFactory; | ||
import org.apache.druid.sql.calcite.BaseCalciteQueryTest; | ||
import org.apache.druid.sql.calcite.CalciteUnionQueryTest; | ||
import org.apache.druid.sql.calcite.QueryTestBuilder; | ||
import org.apache.druid.sql.calcite.run.SqlEngine; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Runs {@link CalciteUnionQueryTest} but with MSQ engine | ||
*/ | ||
public class CalciteUnionQueryMSQTest extends CalciteUnionQueryTest | ||
{ | ||
private TestGroupByBuffers groupByBuffers; | ||
|
||
@Before | ||
public void setup2() | ||
{ | ||
groupByBuffers = TestGroupByBuffers.createDefault(); | ||
} | ||
|
||
@After | ||
public void teardown2() | ||
{ | ||
groupByBuffers.close(); | ||
} | ||
|
||
@Override | ||
public void configureGuice(DruidInjectorBuilder builder) | ||
{ | ||
super.configureGuice(builder); | ||
builder.addModules(CalciteMSQTestsHelper.fetchModules(temporaryFolder, groupByBuffers).toArray(new Module[0])); | ||
} | ||
|
||
|
||
@Override | ||
public SqlEngine createEngine( | ||
QueryLifecycleFactory qlf, | ||
ObjectMapper queryJsonMapper, | ||
Injector injector | ||
) | ||
{ | ||
final WorkerMemoryParameters workerMemoryParameters = | ||
WorkerMemoryParameters.createInstance( | ||
WorkerMemoryParameters.PROCESSING_MINIMUM_BYTES * 50, | ||
2, | ||
10, | ||
2, | ||
0, | ||
0 | ||
); | ||
final MSQTestOverlordServiceClient indexingServiceClient = new MSQTestOverlordServiceClient( | ||
queryJsonMapper, | ||
injector, | ||
new MSQTestTaskActionClient(queryJsonMapper), | ||
workerMemoryParameters | ||
); | ||
return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); | ||
} | ||
|
||
@Override | ||
protected QueryTestBuilder testBuilder() | ||
{ | ||
return new QueryTestBuilder(new BaseCalciteQueryTest.CalciteTestConfig(true)) | ||
.addCustomRunner(new ExtractResultsFactory(() -> (MSQTestOverlordServiceClient) ((MSQTaskSqlEngine) queryFramework().engine()).overlordClient())) | ||
.skipVectorize(true) | ||
.verifyNativeQueries(new VerifyMSQSupportedNativeQueriesPredicate()) | ||
.msqCompatible(msqCompatible); | ||
} | ||
|
||
/** | ||
* Doesn't pass through Druid however the planning error is different as it rewrites to a union datasource. | ||
* This test is disabled because MSQ wants to support union datasources, and it makes little sense to add highly | ||
* conditional planning error for the same. Planning errors are merely hints, and this is one of those times | ||
* when the hint is incorrect till MSQ starts supporting the union datasource. | ||
*/ | ||
@Test | ||
@Override | ||
public void testUnionIsUnplannable() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.