Skip to content

Commit

Permalink
make/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Jul 17, 2024
1 parent 0811d80 commit b100e98
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,30 @@ public MSQTaskSqlEngine createEngine(
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,
final AvaticaServerConfig config,
final ErrorHandler errorHandler,
final AuthenticatorMapper authMapper)
{
return new DruidMeta(sqlStatementFactory, config, errorHandler, authMapper);
return new MSQDruidMeta(sqlStatementFactory, config, errorHandler, authMapper);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ order by 1;
+--------------------------------------------+
| TASK |
+--------------------------------------------+
| query-a0537802-857a-450e-bceb-3c6d1fd142ff |
| query-eeb20bee-0a2a-4812-97d9-ae70a9107f80 |
+--------------------------------------------+
(1 row)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private RuntimeException mapException(Throwable t)
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(
Expand Down

0 comments on commit b100e98

Please sign in to comment.