[
https://issues.apache.org/jira/browse/CALCITE-947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16819695#comment-16819695
]
Chunwei Lei commented on CALCITE-947:
-------------------------------------
[~julianhyde], though it may need a lot more efforts, I believe it is worth
supporting not only literals but also expressions as default values considering
DB2[1] and PostgreSQL[2] supports expressions as default values but only
literals in SQL Server[3].
[1]
[https://www.ibm.com/developerworks/ibmi/library/i-sql-parameter-name-default-value/i-sql-parameter-name-default-value-pdf.pdf]
[2] [https://www.postgresql.org/docs/9.1/sql-createfunction.html]
[3]
[https://docs.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql?view=sql-server-2017]
> Allow optional parameters to have default values other than NULL
> ----------------------------------------------------------------
>
> Key: CALCITE-947
> URL: https://issues.apache.org/jira/browse/CALCITE-947
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Chunwei Lei
> Priority: Major
>
> As of CALCITE-941 user-defined functions can have optional parameters and you
> can omit them or use the DEFAULT keyword. But the default value must be NULL,
> and therefore the parameter must have an optional type.
> This case would remove that restriction and allow default values which are
> literals, or calls to system functions (e.g. USER) or references to other
> parameters, or expressions composed thereof.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)