github-advanced-security[bot] commented on code in PR #16798:
URL: https://github.com/apache/druid/pull/16798#discussion_r1704969658
##########
sql/src/main/java/org/apache/druid/sql/SqlQueryPlus.java:
##########
@@ -116,6 +116,13 @@
return new SqlQueryPlus(sql, queryContext, parameters, authResult);
}
+ @Override
+ public String toString()
+ {
+ return "SqlQueryPlus {queryContext=" + queryContext + ", parameters=" +
parameters
+ + ", authResult=" + authResult + ", sql=" + sql + " }";
Review Comment:
## Use of default toString()
Default toString(): AuthenticationResult inherits toString() from Object,
and so is not suitable for printing.
[Show more
details](https://github.com/apache/druid/security/code-scanning/7674)
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Injector;
+import com.google.inject.Provides;
+import org.apache.druid.guice.LazySingleton;
+import
org.apache.druid.initialization.ServerInjectorBuilderTest.TestDruidModule;
+import org.apache.druid.msq.guice.MultiStageQuery;
+import org.apache.druid.msq.sql.MSQTaskSqlEngine;
+import org.apache.druid.msq.test.MSQTestBase;
+import org.apache.druid.msq.test.MSQTestOverlordServiceClient;
+import org.apache.druid.msq.test.MSQTestTaskActionClient;
+import org.apache.druid.server.QueryLifecycleFactory;
+import org.apache.druid.sql.SqlStatementFactory;
+import org.apache.druid.sql.SqlToolbox;
+import org.apache.druid.sql.avatica.DruidMeta;
+import org.apache.druid.sql.avatica.MSQDruidMeta;
+
+public class TestMSQSqlModule extends TestDruidModule {
+
+ @Provides
+ @MultiStageQuery
+ @LazySingleton
+ public SqlStatementFactory makeMSQSqlStatementFactory(
+ final MSQTaskSqlEngine sqlEngine,
+ SqlToolbox toolbox
+ )
+ {
+ return new SqlStatementFactory(toolbox.withEngine(sqlEngine));
+ }
+
+ @Provides
+ @LazySingleton
+ public MSQTaskSqlEngine createEngine(
+ QueryLifecycleFactory qlf,
+ ObjectMapper queryJsonMapper,
+ Injector injector,
Review Comment:
## Useless parameter
The parameter 'injector' is never used.
[Show more
details](https://github.com/apache/druid/security/code-scanning/7672)
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/TestMSQSqlModule.java:
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableList;
+import com.google.inject.Injector;
+import com.google.inject.Provides;
+import org.apache.druid.guice.LazySingleton;
+import
org.apache.druid.initialization.ServerInjectorBuilderTest.TestDruidModule;
+import org.apache.druid.msq.guice.MultiStageQuery;
+import org.apache.druid.msq.sql.MSQTaskSqlEngine;
+import org.apache.druid.msq.test.MSQTestBase;
+import org.apache.druid.msq.test.MSQTestOverlordServiceClient;
+import org.apache.druid.msq.test.MSQTestTaskActionClient;
+import org.apache.druid.server.QueryLifecycleFactory;
+import org.apache.druid.sql.SqlStatementFactory;
+import org.apache.druid.sql.SqlToolbox;
+import org.apache.druid.sql.avatica.DruidMeta;
+import org.apache.druid.sql.avatica.MSQDruidMeta;
+
+public class TestMSQSqlModule extends TestDruidModule {
+
+ @Provides
+ @MultiStageQuery
+ @LazySingleton
+ public SqlStatementFactory makeMSQSqlStatementFactory(
+ final MSQTaskSqlEngine sqlEngine,
+ SqlToolbox toolbox
+ )
+ {
+ return new SqlStatementFactory(toolbox.withEngine(sqlEngine));
+ }
+
+ @Provides
+ @LazySingleton
+ public MSQTaskSqlEngine createEngine(
+ QueryLifecycleFactory qlf,
Review Comment:
## Useless parameter
The parameter 'qlf' is never used.
[Show more
details](https://github.com/apache/druid/security/code-scanning/7671)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]