diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java index 7e2889c0b3a8..2e44a3772691 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/QueryHandler.java @@ -234,6 +234,9 @@ public String statementKind() return "SELECT"; } + /** + * No target datasource for SELECT/non-DML statements. + */ @Nullable @Override public SqlNode targetDataSource() diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlStatementHandler.java b/sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlStatementHandler.java index d9bfcf8dcd6c..fdc00cec85ca 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlStatementHandler.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/SqlStatementHandler.java @@ -43,7 +43,17 @@ public interface SqlStatementHandler void prepare(); PrepareResult prepareResult(); PlannerResult plan() throws ValidationException; + + /** + * @return the statement kind for a SQL statement. For example, SELECT, INSERT, or REPLACE. + */ String statementKind(); + + /** + * + * @return the SQL node representing the target table in a SQL statement. Returns + * null for SELECT/non-DML statements. + */ @Nullable SqlNode targetDataSource(); /**