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:
   This would only be thrown if we can't serialize one of the objects 
predefined in the code which we are sure would get serialized. (Handles the 
`jsonMapper.writeValueAsString` throw clause). We never intend to encounter 
this exception, and if we do, there's something wrong with the code. Updated 
the error message to indicate this. 



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