KnothHe commented on issue #21233:
URL: 
https://github.com/apache/shardingsphere/issues/21233#issuecomment-1262165148

   @sxlArtless 
   I reproduced, the reason is the table alias. It should be that 
ShardingSphere does not recognize the syntax used with aliases and json `->>`
   
   <img width="1919" alt="image" 
src="https://user-images.githubusercontent.com/25814839/193022614-03800cf9-2313-4f94-9c70-661ab2e61d1f.png";>
   
   
   ```java
   System.out.println(shardingJdbcTemplate.queryForMap("SELECT json_field ->> 
'$.key' FROM json_test WHERE id = ?", 2));
   System.out.println(shardingJdbcTemplate.queryForMap("SELECT jt.json_field 
->> '$.key' FROM json_test jt WHERE id = ?", 2));
   ```
   
   With table alias, this syntax is workd.
   ```java
   System.out.println(shardingJdbcTemplate.queryForMap("SELECT 
JSON_UNQUOTE(JSON_EXTRACT(jt.json_field, '$.key')) FROM json_test jt WHERE id = 
?", 2));
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to