adarshsanjeev commented on code in PR #12431:
URL: https://github.com/apache/druid/pull/12431#discussion_r858362710


##########
sql/src/main/java/org/apache/druid/sql/calcite/planner/DruidPlanner.java:
##########
@@ -221,6 +222,19 @@ public PlannerResult plan() throws SqlParseException, 
ValidationException, RelCo
     final SqlNode validatedQueryNode = 
planner.validate(parameterizedQueryNode);
     final RelRoot rootQueryRel = planner.rel(validatedQueryNode);
 
+    if (parsed.getInsertNode() != null) {
+      // Check that there are no unnamed columns in the insert.
+      // We do this validation here since we need the rel nodes for this.
+      for (Pair<Integer, String> field : rootQueryRel.fields) {
+        if (UNNAMED_COLUMN_PATTERN.matcher(field.right).matches()) {

Review Comment:
   Done



##########
sql/src/test/java/org/apache/druid/sql/calcite/CalciteInsertDmlTest.java:
##########
@@ -743,6 +743,38 @@ public void testInsertWithInvalidSelectStatement()
         .verify();
   }
 
+  @Test

Review Comment:
   Added a test for this case



-- 
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]

Reply via email to