Skip to content

Commit

Permalink
review comment: add Nullable annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekrb19 committed Apr 12, 2023
1 parent fba9e43 commit eeddf19
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.apache.druid.sql.calcite.run.EngineFeature;
import org.apache.druid.sql.calcite.run.QueryMaker;

import javax.annotation.Nullable;
import java.util.List;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -280,6 +281,7 @@ public String statementKind()
return DruidSqlInsert.OPERATOR.getName();
}

@Nullable
@Override
public SqlNode targetDataSource()
{
Expand Down Expand Up @@ -350,6 +352,7 @@ public String statementKind()
return DruidSqlReplace.OPERATOR.getName();
}

@Nullable
@Override
public SqlNode targetDataSource()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,15 @@ public String getStatementKind()
return this.statementKind;
}

public void setStatementKind(String sqlKind)
public void setStatementKind(String statementKind)
{
if (this.statementKind != null) {
throw new ISE("StatementKind has already been set");
}
this.statementKind = sqlKind;
this.statementKind = statementKind;
}

@Nullable
public SqlNode getTargetDataSource()
{
return this.targetDataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public String statementKind()
return "SELECT";
}

@Nullable
@Override
public SqlNode targetDataSource()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.druid.sql.calcite.run.SqlEngine;
import org.joda.time.DateTimeZone;

import javax.annotation.Nullable;
import java.util.Map;
import java.util.Set;

Expand All @@ -43,7 +44,7 @@ public interface SqlStatementHandler
PrepareResult prepareResult();
PlannerResult plan() throws ValidationException;
String statementKind();
SqlNode targetDataSource();
@Nullable SqlNode targetDataSource();

/**
* Context available to statement handlers.
Expand Down

0 comments on commit eeddf19

Please sign in to comment.