[ 
https://issues.apache.org/jira/browse/CALCITE-3504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16974182#comment-16974182
 ] 

Feng Zhu commented on CALCITE-3504:
-----------------------------------

Is this feature important in some scenarios?

Calcite parser allows empty array, but the validator rejects it, because it 
can't determine the type of an empty array.

I test it in PostgreSQL. It also throws exception ("cannot determine type of 
empty array").

For your requirement, I think it is better to implement a function, in which 
you can create empty array with specified type.

> allow empty ARRAY[] literals
> ----------------------------
>
>                 Key: CALCITE-3504
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3504
>             Project: Calcite
>          Issue Type: Wish
>    Affects Versions: 1.21.0
>            Reporter: Pressenna
>            Priority: Major
>
> Currently an ARRAY expression requires at least one element.
> Please allow empty ARRAY expressions.
> {code:sql}
> SELECT ARRAY[] FROM foo;
> -- or more concise for updates:
> UPDATE food set array_column = ARRAY[];
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to