[
https://issues.apache.org/jira/browse/CALCITE-6566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17880338#comment-17880338
]
suibianwanwan commented on CALCITE-6566:
----------------------------------------
+1, Presto and ClickHouse also support {{{}PI(){}}}, And require parentheses.
> PI function without parentheses shoud failed
> --------------------------------------------
>
> Key: CALCITE-6566
> URL: https://issues.apache.org/jira/browse/CALCITE-6566
> Project: Calcite
> Issue Type: Improvement
> Reporter: xiong duan
> Priority: Major
>
> Now In Calcite, support the PI function:
> {code:java}
> select PI();
> CalciteContextException: No match found for function signature PI()
> select PI;
> 3.141592653589793{code}
> However, they always need parentheses when I test in different data sources.
> Spark:
> {code:java}
> select PI();
> return 3.141592653589793
> select PI;
> Error in query: cannot resolve '`PI`' given input columns: []; line 1 pos
> 7;{code}
> Hive:
> {code:java}
> select PI();
> return 3.141592653589793
> select PI;
> SemanticException [Error 10004]: Line 1:7 Invalid table alias or column
> reference 'PI': (possible column names are: ) (state=42000,code=10004){code}
> Postgresql:
> {code:java}
> select PI();
> return 3.141592653589793
> select PI;
> ERROR: column "pi" does not exist{code}
> MySQL:
> {code:java}
> select PI();
> return 3.141593
> select PI;
> ERROR 1054 (42S22) at line 1: Unknown column 'PI' in 'field list'{code}
> SQLServer:
> {code:java}
> select PI();
> 3.1415926535897931
> select PI;{code}
> So do we use PI in Calcite then generate PI() in Jdbc Dialect or we change
> the Calcite support PI() to replace PI;
--
This message was sent by Atlassian Jira
(v8.20.10#820010)