abhishekagarwal87 commented on code in PR #12386:
URL: https://github.com/apache/druid/pull/12386#discussion_r858550709
##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidPlanner.java:
##########
@@ -761,84 +771,117 @@ public T next()
private final SqlExplain explain;
@Nullable
- private final DruidSqlInsert insert;
+ private final SqlInsert insertOrReplace;
private final SqlNode query;
@Nullable
private final Granularity ingestionGranularity;
+ @Nullable
+ private final List<String> replaceIntervals;
+
private ParsedNodes(
@Nullable SqlExplain explain,
- @Nullable DruidSqlInsert insert,
+ @Nullable SqlInsert insertOrReplace,
SqlNode query,
- @Nullable Granularity ingestionGranularity
+ @Nullable Granularity ingestionGranularity,
+ @Nullable List<String> replaceIntervals
)
{
this.explain = explain;
- this.insert = insert;
+ this.insertOrReplace = insertOrReplace;
this.query = query;
this.ingestionGranularity = ingestionGranularity;
+ this.replaceIntervals = replaceIntervals;
}
- static ParsedNodes create(final SqlNode node) throws ValidationException
+ static ParsedNodes create(final SqlNode node, DateTimeZone dateTimeZone)
throws ValidationException
{
SqlExplain explain = null;
DruidSqlInsert druidSqlInsert = null;
+ DruidSqlReplace druidSqlReplace = null;
SqlNode query = node;
Granularity ingestionGranularity = null;
+ List<String> replaceIntervals = null;
if (query.getKind() == SqlKind.EXPLAIN) {
explain = (SqlExplain) query;
query = explain.getExplicandum();
}
if (query.getKind() == SqlKind.INSERT) {
Review Comment:
could you break down this large function to smaller functions like
`handleInsert` and `handleReplace`?
--
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]