[
https://issues.apache.org/jira/browse/CALCITE-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16838458#comment-16838458
]
Hongze Zhang commented on CALCITE-3017:
---------------------------------------
Since the issue blocks the attempt on rebasing fix of CALCITE-2985, I am
inclined to merge the PR soon (maybe before 1.20.0 release, it would be great
if someone wants to help to review :)).
A little bit more:
Some JSON functions are more complicated than regular functions, as they
always allow some user-specified flags to customize behaviors during the
execution process, such as input format, implicit input format, output format,
error handling, null handling, and so on. However to myself it is more
important to make the code simple and readable than to prepare changes for all
possible functionalities. If there are too much nested structures in function
parameter list, then more hardness will be brought to user when implementing
these functions. This is also one of the reason why removing several operators
(such as {{JSON_STRUCTURED_VALUE_EXPRESSION}},
{{JSON_API_COMMON_SYNTAX_WITHOUT_PATH}}, {{JSON_VALUE_EXPRESSION}}) in recent
code changes of JSON support.
> Improve null handling of JsonValueExpressionOperator
> ----------------------------------------------------
>
> Key: CALCITE-3017
> URL: https://issues.apache.org/jira/browse/CALCITE-3017
> Project: Calcite
> Issue Type: Sub-task
> Reporter: Hongze Zhang
> Assignee: Hongze Zhang
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.20.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> In Calcite's implementation, {{JsonValueExpressionOperator}} currently
> returns a null value no matter the argument is JSON NULL value or SQL NULL
> value. But in MySQL, some JSON functions behave differently on different null
> inputs. For instance for a MySQL JSON function {{JSON_STORAGE_SIZE}}, if we
> execute:
> {code:sql}
> SELECT JSON_STORAGE_SIZE(null), JSON_STORAGE_SIZE('null')
> {code}
> The result should be:
> ||JSON_STORAGE_SIZE(null)||JSON_STORAGE_SIZE('null')||
> |null|2|
> We should improve the operator a bit to support different behaviors.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)