question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ALL/ANY/SOME do not accept Value Lists.

See original GitHub issue

Describe the bug Error when converting sql using “CCJSqlParserUtil.parse(sql)”, sql with condition “nin ( != )” others like eq / neq / in / isnull and isnnull work normal To Reproduce Steps to reproduce the behavior:

  1. Example SQL select t0.total_value, t0.code, t0.expected_at, t0.description, t0.id, t0.status, t5.id, t5.name, t5.id, t4.id, t4.id, t1.id, t1 .name, t2.id, t2.name, t3.id, t3.description from opportunity t0 left join "user" t5 on t5.id = t0.user_id left join stage t4 on t4.id = t0.stage_id left join customer t1 on t1.id = t0.customer_id left join lead t2 on t2.id = t0.lead_id left join opportunity_type t3 on t3.id = t0.opportunity_type_id where t0.pipeline_id = ? and t0.status = ? and t0.updated_at > ? and (t0.customer_id != all(?::uuid[]) or t0.customer_id is null ) order by t0.total_value desc, t0.code desc
  2. Parsing this SQL using: CCJSqlParserUtil.parse(sql)
  3. Exception
Parameters: {rankBy=[stage.id],q=[{pipeline.id->eq->4542a6a0-29a5-4bd8-9857-314f20e648a3}{status->eq->PROGRESS}{updatedAt->gt->2021-03-04T02:59:59.999Z}({customer.id->nin->[1e7d13d3-b43a-4651-a3ca-0b78a5fa84ee]}||{customer.id->isnull}){orderby->[totalValue desc,code desc]}{select->[id,description,code,status,totalValue,expectedAt,lead.name,customer.name,opportunityType.description,user.id,user.name,stage.id,activityCount]}{pageSize->10}{firstRow->0}]}
java.lang.IllegalArgumentException: net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "!=" <OP_NOTEQUALSBANG>
    at line 1, column 523.

Was expecting one of:

    "&"
    "&&"
    ")"
    "::"
    "<<"
    ">>"
    "AND"
    "COLLATE"
    "OR"
    "["
    "^"
    "|"

	at com.ws.opportunity.opportunity.OpportunityRankQueryFactory.build(OpportunityRankQueryFactory.java:74) ~[main/:?]
	at com.ws.opportunity.opportunity.OpportunityRankQueryFactory$Proxy$_$$_WeldClientProxy.build(Unknown Source) ~[main/:?]
	at com.ws.opportunity.opportunity.OpportunityDAO.list(OpportunityDAO.java:195) ~[main/:?]
	at com.ws.opportunity.opportunity.OpportunityService.findList(OpportunityService.java:159) ~[main/:?]
	at com.ws.opportunity.opportunity.OpportunityResource.list(OpportunityResource.java:128) ~[main/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_281]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_281]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_281]

System Database -> Postgres Java Version-> Java 8 JSqlParser version -> tried with 3.2 and 4.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
manticore-projectscommented, Jun 18, 2021

Solved by PR #1233

0reactions
manticore-projectscommented, Jun 17, 2021

Maybe change the Title of the issue into something like ALL/ANY/SOME do not accept Value Lists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL ANY and ALL Operators - W3Schools
The SQL ANY Operator​​ The ANY operator: returns a boolean value as a result. returns TRUE if ANY of the subquery values meet...
Read more >
python - Using any() and all() to check if a list contains one set ...
Generally speaking: all and any are functions that take some iterable and return True , if. in the case of all , no...
Read more >
Value lists troubleshooting - FileMaker Pro
If the value list is obtaining its values from a field, make sure the field type matches the values you've entered.
Read more >
Only allow values contained in a list to be entered into a cell
http://www.TeachMsOffice.comThis tutorial will show you how to prevent a user from entering a value in a cell in excel which is not ......
Read more >
Examples of query criteria - Microsoft Support
Query criteria help you zero in on specific items in an Access database. If an item matches all the criteria you enter, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found