NobiGo commented on code in PR #3956:
URL: https://github.com/apache/calcite/pull/3956#discussion_r1857532165


##########
core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java:
##########
@@ -1854,7 +1854,7 @@ public class SqlStdOperatorTable extends 
ReflectiveSqlOperatorTable {
   public static final SqlFunction PI =
       SqlBasicFunction.create("PI", ReturnTypes.DOUBLE, OperandTypes.NILADIC,
           SqlFunctionCategory.NUMERIC)
-          .withSyntax(SqlSyntax.FUNCTION_ID);
+          .withSyntax(SqlSyntax.FUNCTION_ID_CONSTANT);

Review Comment:
   The Function like 
USER、CURRENT_TIME、CURRENT_USER、SESSION_USER、SYSTEM_USER、CURRENT_PATH、CURRENT_ROLE、CURRENT_CATALOG、CURRENT_SCHEMA、LOCALTIME、LOCALTIMESTAMP、CURRENT_TIME
 and CURRENT_TIMESTAMP behaviour controlled by `allowNiladicParentheses`. 
   
   Before this PR, The PI is also controlled by `allowNiladicParentheses`, but 
this will result in differences in behavior compared to other databases. In 
other databases the PI always needs parentheses.
   
    I add `allowNiladicConstantWithoutParentheses`.On the one hand, it is to be 
compatible with the current implementation of Calcite, and on the other hand, 
to make its calls more in line with the usage of most databases.



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