JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

The ->> operation in postgresql does not work properly

Open offSwitch opened this issue 3 years ago • 1 comments
trafficstars

select visit_hour,json_array_elements(into_sex_json)->>'name',json_array_elements(into_sex_json)->>'value' from period_market

offSwitch avatar Jun 20 '22 10:06 offSwitch

The problem here is that JSqlParser does only support:

column ->> literal

a function as a first "parameter" is not supported. Something you want to provide. PRs are welcome.

wumpz avatar Jul 03 '22 20:07 wumpz

I'm using the latest version 4.6 and this problem seems not solved yet. Would it be possible to be fixed in the future?

yasu1209 avatar Mar 13 '23 11:03 yasu1209

Unfortunately, allowing Function() is not possible as it will break performance reason. I think, this one is beyond any refactoring and tricks. A new and clean Grammar would be needed to achieve that.

manticore-projects avatar Mar 14 '23 01:03 manticore-projects

Unfortunately, allowing Function() is not possible as it will break performance reason. I think, this one is beyond any refactoring and tricks. A new and clean Grammar would be needed to achieve that.

Thank you for your reply. I'll check my code to see if it can be refactored.

yasu1209 avatar Mar 14 '23 01:03 yasu1209

PR #1745 allows Function() ->> Literal as long as the Function is simple (no nested expressions as parameters).

manticore-projects avatar Mar 14 '23 01:03 manticore-projects