You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/02/24 00:36:50 UTC

[GitHub] [calcite] GavinRay97 opened a new pull request #2730: Modify parser to allow subqueries in JSON "VALUE"

GavinRay97 opened a new pull request #2730:
URL: https://github.com/apache/calcite/pull/2730


   Allows to execute expressions like the below:
   
   ```sql
   SELECT JSON_OBJECT(
     KEY 'foo'
     VALUE (SELECT 'bar')
   )
   ```


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [calcite] GavinRay97 commented on pull request #2730: [CALCITE-4989] Fix nested JSON value formatting. Also, modify parser to allow subqueries in JSON "VALUE"

Posted by GitBox <gi...@apache.org>.
GavinRay97 commented on pull request #2730:
URL: https://github.com/apache/calcite/pull/2730#issuecomment-1050061787


   [Second commit fixes 4989](https://issues.apache.org/jira/browse/CALCITE-4989)
   
   


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [calcite] GavinRay97 commented on pull request #2730: Modify parser to allow subqueries in JSON "VALUE"

Posted by GitBox <gi...@apache.org>.
GavinRay97 commented on pull request #2730:
URL: https://github.com/apache/calcite/pull/2730#issuecomment-1074674860


   I've reverted the changes in formatting, based on the discussion in the mailing list here:
   - https://lists.apache.org/thread/5t5nmj05ocz3z40gyfvj2gw98r1b6m54
   
   It turns out that the trick is to use `FORMAT JSON` on every JSON expression, it prevents the issue with escaping.
   
   PR is ready for review now


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [calcite] GavinRay97 commented on pull request #2730: [CALCITE-4989] Fix nested JSON value formatting. Also, modify parser to allow subqueries in JSON "VALUE"

Posted by GitBox <gi...@apache.org>.
GavinRay97 commented on pull request #2730:
URL: https://github.com/apache/calcite/pull/2730#issuecomment-1052495462


   This is trickier than I thought actually, since each JSON call invokes `jsonize()`, if you have nested JSON functions they will be parsed `n` number of times.
   
   Each parse will add another set of escapes. The only proper way to handle this is to parse only once, at the top-level object, but this isn't currently possibly as far as I know =/
   


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org