github-code-scanning[bot] commented on code in PR #13798:
URL: https://github.com/apache/druid/pull/13798#discussion_r1111128671


##########
sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java:
##########
@@ -379,37 +384,44 @@
             StringComparators.NUMERIC
         );
       default:
-        throw new ValidationException("Unsupported operation in OVERWRITE 
WHERE clause: " + sqlBasicCall.getOperator().getName());
+        throw DruidException.validationError(
+            "Unsupported operation in OVERWRITE WHERE clause: %s",
+            sqlBasicCall.getOperator().getName()
+        );
     }
   }
 
   /**
    * Converts a {@link SqlNode} identifier into a string representation
    *
-   * @param sqlNode the sql node
+   * @param sqlNode the SQL node
    * @return string representing the column name
-   * @throws ValidationException if the sql node is not an SqlIdentifier
+   * @throws ValidationException if the SQL node is not an SqlIdentifier

Review Comment:
   ## Javadoc has impossible 'throws' tag
   
   Javadoc for parseColumnName claims to throw ValidationException but this is 
impossible.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/4311)



##########
sql/src/main/java/org/apache/druid/sql/calcite/parser/DruidSqlParserUtils.java:
##########
@@ -379,37 +384,44 @@
             StringComparators.NUMERIC
         );
       default:
-        throw new ValidationException("Unsupported operation in OVERWRITE 
WHERE clause: " + sqlBasicCall.getOperator().getName());
+        throw DruidException.validationError(
+            "Unsupported operation in OVERWRITE WHERE clause: %s",
+            sqlBasicCall.getOperator().getName()
+        );
     }
   }
 
   /**
    * Converts a {@link SqlNode} identifier into a string representation
    *
-   * @param sqlNode the sql node
+   * @param sqlNode the SQL node
    * @return string representing the column name
-   * @throws ValidationException if the sql node is not an SqlIdentifier
+   * @throws ValidationException if the SQL node is not an SqlIdentifier
    */
-  public static String parseColumnName(SqlNode sqlNode) throws 
ValidationException
+  public static String parseColumnName(SqlNode sqlNode)
   {
     if (!(sqlNode instanceof SqlIdentifier)) {
-      throw new ValidationException("Expressions must be of the form __time 
<operator> TIMESTAMP");
+      throw DruidException.validationError(
+          "OVERWRITE WHERE expressions must be of the form __time <operator> 
TIMESTAMP"
+      );
     }
     return ((SqlIdentifier) sqlNode).getSimple();
   }
 
   /**
    * Converts a {@link SqlNode} into a timestamp, taking into account the 
timezone
    *
-   * @param sqlNode the sql node
+   * @param sqlNode the SQL node
    * @param timeZone timezone
    * @return the timestamp string as milliseconds from epoch
-   * @throws ValidationException if the sql node is not a SqlTimestampLiteral
+   * @throws ValidationException if the SQL node is not a SqlTimestampLiteral

Review Comment:
   ## Javadoc has impossible 'throws' tag
   
   Javadoc for parseTimeStampWithTimeZone claims to throw ValidationException 
but this is impossible.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/4312)



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