github-advanced-security[bot] commented on code in PR #15711:
URL: https://github.com/apache/druid/pull/15711#discussion_r1456553673
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/CalcitePlanner.java:
##########
@@ -133,6 +141,41 @@
this.context = config.getContext();
this.connectionConfig = connConfig(context);
this.typeSystem = config.getTypeSystem();
+
+ // With the catalog, schemas can provide functions.
+ // Add the necessary indirection. The type factory used here
+ // is the Druid one, since the per-query one is not yet available
+ // here. Nor are built-in function associated with per-query types.
+ this.operatorTable = new ChainedSqlOperatorTable(
Review Comment:
## Deprecated method or constructor invocation
Invoking [ChainedSqlOperatorTable.ChainedSqlOperatorTable](1) should be
avoided because it has been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6469)
##########
sql/src/main/java/org/apache/druid/sql/calcite/run/QueryMaker.java:
##########
@@ -28,6 +29,17 @@
*/
public interface QueryMaker
{
+ /**
+ * Do everything that would be done to run a query, don't actually run.
+ * Instead return what would have been sent to the execution engine.
+ * The result is a Jackson-serializable query plan.
+ */
+ default Object explain(DruidQuery druidQuery)
Review Comment:
## Useless parameter
The parameter 'druidQuery' is never used.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6471)
##########
sql/src/test/java/org/apache/druid/sql/calcite/planner/PlannerCaptureHook.java:
##########
@@ -33,11 +35,14 @@
private RelRoot relRoot;
private SqlInsert insertNode;
private SqlNode sqlNode;
+ private DruidRel<?> druidRel;
+ private Object execPlan;
@Override
public void captureSql(String sql)
{
- // Not used at present. Add a field to capture this if you need it.
+ this.druidRel = druidRel;
Review Comment:
## Self assignment
This expression assigns druidRel to itself.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6470)
##########
sql/src/main/java/org/apache/druid/sql/calcite/run/SqlEngine.java:
##########
@@ -94,6 +94,7 @@
QueryMaker buildQueryMakerForInsert(
String targetDataSource,
RelRoot relRoot,
- PlannerContext plannerContext
+ PlannerContext plannerContext,
+ RelDataType targetType
Review Comment:
## Useless parameter
The parameter 'targetType' is never used.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6472)
--
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]