Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fileld names with underscore break parsing of query [moved] #241

Closed
lvca opened this issue Dec 10, 2012 · 0 comments
Closed

Using fileld names with underscore break parsing of query [moved] #241

lvca opened this issue Dec 10, 2012 · 0 comments

Comments

@lvca
Copy link
Member

lvca commented Dec 10, 2012

This is Issue 241 moved from a Google Code project.
Added by 2011-02-22T12:03:11.000Z by ro.franc...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, v0.9.25

Original description

We use filed names with underscore. A document is like this (json):
{
 "@type": "d", "@rid": "5:0", "@class": "Item",
 "bobina": "BOBINA0003",
 "issue_year": "1949",
 "issue_date": "04.06.1949",
 "type": "issue",
 "issue_edition": "0133",
 "publication_code": "01",
 "issue_key": "01_1949_0133",
 "publication_name": "01_Pubs",
 "language": "it",
 "uuid": "3a79ca7a-c139-4b2c-84c4-cf46d0538c96",
 "issue_edition_int": "0133",
 "issue_decade": "1940"
}

Using fields whith underscore breaks the query parser:

select * from Item where issue_year > 1910 and type = 'issue' limit 10

So it seems the query parser tokenize on the underscore and then
consider YEAR as an operator.
I dived into the code, but I can't find where and if it happens.
Here's the stack trace:

com.orientechnologies.orient.core.exception.OQueryParsingException:
Error on parsing query at position #21: Unknown operator YEAR
Query: Item where issue_year > 1910 and type = 'issue'
--------------------------^
       at com.orientechnologies.orient.core.sql.filter.OSQLFilter.extractConditionOperator(OSQLFilter.java:228)
       at com.orientechnologies.orient.core.sql.filter.OSQLFilter.extractCondition(OSQLFilter.java:195)
       at com.orientechnologies.orient.core.sql.filter.OSQLFilter.extractConditions(OSQLFilter.java:170)
       at com.orientechnologies.orient.core.sql.filter.OSQLFilter.<init>(OSQLFilter.java:69)
       at com.orientechnologies.orient.core.sql.OSQLEngine.parseWhereCondition(OSQLEngine.java:90)
       at com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:130)
       at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:39)
       at com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:28)
       at com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:54)
       at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:61)
       at com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:72)
       at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:37)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant