LakshSingla commented on code in PR #14534:
URL: https://github.com/apache/druid/pull/14534#discussion_r1257779970


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java:
##########
@@ -136,15 +136,24 @@ public QueryResponse<Object[]> runQuery(final DruidQuery 
druidQuery)
                                    
.orElse(jsonMapper.writeValueAsString(DEFAULT_SEGMENT_GRANULARITY));
     }
     catch (JsonProcessingException e) {
-      throw new IAE("Unable to deserialize the insert granularity. Please 
retry the query with a valid "
-                    + "segment graularity");
+      // This isn't populated by the user in the query context. If there was 
an issue with the query granularity
+      // entered by the user, it should have been flagged earlier
+      throw DruidException.forPersona(DruidException.Persona.DEVELOPER)
+                          .ofCategory(DruidException.Category.DEFENSIVE)
+                          .build(
+                              e,
+                              "Unable to deserialize the insert granularity. 
Please retry the query with a "
+                              + "valid segment graularity"
+                          );

Review Comment:
   I updated a comment to state why this is a defensive exception.
   
   This parameter is added by Druid while processing `PARTITIONED BY _____`. 
User inputs whatever is in front of the partitioned by we populate the query 
context based on that. Therefore whatever hits this exception has been 
sanitized and populated by us (after already going through a 
transformation-serialization process). We don't ever wish to encounter this in 
a normal misinput situation, any exception or incorrect input from the user 
would have been flagged by the SQL parser or while serializing.



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