LakshSingla commented on code in PR #14534:
URL: https://github.com/apache/druid/pull/14534#discussion_r1257957476
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/sql/MSQTaskQueryMaker.java:
##########
@@ -201,15 +210,19 @@ public QueryResponse<Object[]> runQuery(final DruidQuery
druidQuery)
if (targetDataSource != null) {
if (ctxDestination != null &&
!DESTINATION_DATASOURCE.equals(ctxDestination)) {
- throw new IAE("Cannot INSERT with destination [%s]", ctxDestination);
+ throw DruidException.forPersona(DruidException.Persona.DEVELOPER)
+ .ofCategory(DruidException.Category.DEFENSIVE)
+ .build("Cannot INSERT with destination [%s]",
ctxDestination);
}
Granularity segmentGranularityObject;
try {
segmentGranularityObject = jsonMapper.readValue((String)
segmentGranularity, Granularity.class);
}
catch (Exception e) {
- throw new ISE("Unable to convert %s to a segment granularity",
segmentGranularity);
+ throw DruidException.forPersona(DruidException.Persona.DEVELOPER)
+ .ofCategory(DruidException.Category.DEFENSIVE)
+ .build("Unable to convert %s to a segment
granularity", segmentGranularity);
Review Comment:
Good point on keeping the exception. I updated the exception message 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]