cshuo commented on pull request #17186: URL: https://github.com/apache/flink/pull/17186#issuecomment-920631983
> There is one interesting point still: > > ``` > -- '{"A":{"K":"V"}}' > JSON_OBJECT('A' VALUE JSON_OBJECT('K' VALUE 'V')) > > -- '{"A":"{\"K\":\"V\"},\"EXPR$0\":1}' > JSON_OBJECT('A' VALUE JSON_OBJECT('K' VALUE 'V'), 'B' VALUE ROW(1)) > ``` > > When one of the arguments is of type `ROW`, it seems that the RexCalls are replaced by RexLiterals, breaking the logic to nest JSON calls. I'm not yet sure why that happens. > > Edit: The problem is ReduceExpressionsRule. We have to make this function non-deterministic since the result depends on the context and not purely on the operands. > > Edit 2: After offline discussion we decided to instead exclude it from expression reduction. Making it non-deterministic has a lot of impact. @Airblader I test `JSON_OBJECT('A' VALUE JSON_OBJECT('K' VALUE 'V'), 'B' VALUE ROW(1))` using this pr as code base, and get result `{"A":{"K":"V"},"B":{"EXPR$0":1}}`. The result looks confusing, shouldn't it be `{"A":{"K":"V"},"B":(1)}`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org