asolimando commented on code in PR #2782:
URL: https://github.com/apache/calcite/pull/2782#discussion_r859875686


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlDatePartFunction.java:
##########
@@ -56,6 +58,11 @@ public SqlDatePartFunction(String name, TimeUnit timeUnit) {
 
   @Override public SqlNode rewriteCall(SqlValidator validator, SqlCall call) {
     final List<SqlNode> operands = call.getOperandList();
+
+    Preconditions.checkArgument(operands.size() == 1,
+        String.format("Invalid number of arguments to function '%s'."
+            + " Was expecting 1 arguments", getName()));

Review Comment:
   Nitpick suggestion:
   ```suggestion
       Preconditions.checkArgument(operands.size() == 1,
           String.format("Invalid number of arguments for function '%s'."
               + " Was expecting 1 argument, found %d", getName(), 
operands.size()));
   ```
   If you agree, then please update also the test results accordingly.



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

Reply via email to