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

Hongze Zhang edited comment on CALCITE-4785 at 9/18/21, 9:38 AM:
-----------------------------------------------------------------

It should be feasible to add some extra checks to SqlJsonValueFunction and 
SqlJsonQueryFunction (I see we used to have some then removed in some 
refactors. Although this kind of check was too not included). Just went through 
the current Parser code and it looks fine to me.


was (Author: zhztheplayer):
It should be feasible to add some extra checks to SqlJsonValueFunction and 
SqlJsonQueryFunction. Just went through the current Parser code and it looks 
fine to me.

> The parser allows multiple ON ERROR or ON EMPTY clauses for JSON_QUERY and 
> JSON_VALUE
> -------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4785
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4785
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.27.0
>            Reporter: Viliam Durina
>            Priority: Minor
>         Attachments: screenshot-1.png
>
>
> The following expression parses succesfully:
> {{JSON_VALUE('bad-json', '$' DEFAULT 1 ON ERROR DEFAULT 2 ON ERROR)}}
> The 2nd ON ERROR clause overrides the 1st one and the expression returns 
> {{2}}. Instead, an error should be thrown.



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

Reply via email to