diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDrillWindowQueryTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDrillWindowQueryTest.java index e4d4c8e04ad..96e75f5b729 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDrillWindowQueryTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDrillWindowQueryTest.java @@ -153,7 +153,22 @@ public class MSQDrillWindowQueryTest extends DrillWindowQueryTest return new MSQTaskSqlEngine(indexingServiceClient, queryJsonMapper); } - @Provides + +// @Override +// public void configure(Binder binder) +// { +// binder.bind(DruidMeta.class).to(MSQDruidMeta.class).in(LazySingleton.class); +// } + +@Provides +@LazySingleton +public DruidMeta createMeta( + MSQDruidMeta druidMeta) +{ + return druidMeta; +} + +// @Provides @LazySingleton public DruidMeta createMeta( final @MultiStageQuery SqlStatementFactory sqlStatementFactory, @@ -161,7 +176,7 @@ public class MSQDrillWindowQueryTest extends DrillWindowQueryTest final ErrorHandler errorHandler, final AuthenticatorMapper authMapper) { - return new DruidMeta(sqlStatementFactory, config, errorHandler, authMapper); + return new MSQDruidMeta(sqlStatementFactory, config, errorHandler, authMapper); } } diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDruidMeta.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDruidMeta.java new file mode 100644 index 00000000000..ec2b85ce973 --- /dev/null +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQDruidMeta.java @@ -0,0 +1,49 @@ +/* + * 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.exec; + +import com.google.inject.Inject; +import org.apache.druid.msq.guice.MultiStageQuery; +import org.apache.druid.server.security.AuthenticatorMapper; +import org.apache.druid.sql.SqlStatementFactory; +import org.apache.druid.sql.avatica.AbstractDruidJdbcStatement; +import org.apache.druid.sql.avatica.AvaticaServerConfig; +import org.apache.druid.sql.avatica.DruidMeta; +import org.apache.druid.sql.avatica.ErrorHandler; + +public class MSQDruidMeta extends DruidMeta +{ + @Inject + public MSQDruidMeta( + final @MultiStageQuery SqlStatementFactory sqlStatementFactory, + final AvaticaServerConfig config, + final ErrorHandler errorHandler, + final AuthenticatorMapper authMapper) + { + super(sqlStatementFactory, config, errorHandler, authMapper); + } + + @Override + protected ExecuteResult doFetch(AbstractDruidJdbcStatement druidStatement, int maxRows) + { + return super.doFetch(druidStatement, maxRows); + } + +} diff --git a/extensions-core/multi-stage-query/src/test/quidem/org.apache.druid.msq.exec.MSQQuidemTest/decoupled.iq b/extensions-core/multi-stage-query/src/test/quidem/org.apache.druid.msq.exec.MSQQuidemTest/decoupled.iq index d17f1d6f34a..285dc9cf3a8 100644 --- a/extensions-core/multi-stage-query/src/test/quidem/org.apache.druid.msq.exec.MSQQuidemTest/decoupled.iq +++ b/extensions-core/multi-stage-query/src/test/quidem/org.apache.druid.msq.exec.MSQQuidemTest/decoupled.iq @@ -10,7 +10,7 @@ order by 1; +--------------------------------------------+ | TASK | +--------------------------------------------+ -| query-a0537802-857a-450e-bceb-3c6d1fd142ff | +| query-eeb20bee-0a2a-4812-97d9-ae70a9107f80 | +--------------------------------------------+ (1 row) diff --git a/sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java b/sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java index 4fb61117721..e271a6f60ab 100644 --- a/sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java +++ b/sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java @@ -395,7 +395,7 @@ public class DruidMeta extends MetaImpl throw errorHandler.sanitize(t); } - private ExecuteResult doFetch(AbstractDruidJdbcStatement druidStatement, int maxRows) + protected ExecuteResult doFetch(AbstractDruidJdbcStatement druidStatement, int maxRows) { final Signature signature = druidStatement.getSignature(); final Frame firstFrame = druidStatement.nextFrame(