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

Issues with MATCH #8414

Closed
hrstoyanov opened this issue Jul 18, 2018 · 4 comments
Closed

Issues with MATCH #8414

hrstoyanov opened this issue Jul 18, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@hrstoyanov
Copy link

hrstoyanov commented Jul 18, 2018

OrientDB Version: 3.0.5-SNAPSHOT

Java Version: 8

OS: Windows

Expected behavior

I cannot get the MATCH queries to work at all for 2 vertexes (Account, Staffer) connected with an edge (WorksFor):

match {class: Account, as: a}-WorksFor-{class: Staffer, as: s} return s
match {class: Account, as: a} return a
match {class: Account, as: a}--{class: WorksFor, as: w}--{class: Staffer, as: s} return a,s,w

See the below example:

Steps to reproduce

orientdb {db=rehabowner.db}> select from Account

+----+-----+-------+--------+----+-------------+--------+------------------+--------------------+
|#   |@RID |@CLASS |stripeId|name|emailAddress |livemode|subscriptionStatus|subscriptionLivemode|
+----+-----+-------+--------+----+-------------+--------+------------------+--------------------+
|0   |#65:0|Account|test    |Test|[email protected]|false   |active            |false               |
+----+-----+-------+--------+----+-------------+--------+------------------+--------------------+

1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=rehabowner.db}> select from Staffer

+----+-----+-------+------------------------------+--------------------+---------+--------+-------------+-------------+-------+-------+
|#   |@RID |@CLASS |auth0Id                       |email               |firstName|lastName|phoneVerified|emailVerified|blocked|created|
+----+-----+-------+------------------------------+--------------------+---------+--------+-------------+-------------+-------+-------+
|0   |#89:0|Staffer|auth0|5b3cfedea177ac1965fab185|[email protected]|Hristo   |Stoyanov|             |true         |       |#209:0 |
+----+-----+-------+------------------------------+--------------------+---------+--------+-------------+-------------+-------+-------+

1 item(s) found. Query executed in 0.001 sec(s).
orientdb {db=rehabowner.db}> select from WorksFor

+----+-----+--------+-----+-----+-----+
|#   |@RID |@CLASS  |state|in   |out  |
+----+-----+--------+-----+-----+-----+
|0   |#97:0|WorksFor|A    |#89:0|#65:0|
+----+-----+--------+-----+-----+-----+

1 item(s) found. Query executed in 0.001 sec(s).

orientdb {db=rehabowner.db}> describe WorksFor

CLASS 'WorksFor'

Records..............: 1
Super classes........: [E, Tracker]
Default cluster......: worksfor (id=97)
Supported clusters...: worksfor(97), worksfor_1(98), worksfor_2(99), worksfor_3(100), worksfor_4(101), worksfor_5(102), worksfor_6(103), worksfor_7(104)
Cluster selection....: round-robin
Oversize.............: 0.0

PROPERTIES
+----+------------+-----------------+---------+--------+--------+----+----+-------+-------+
|#   |NAME        |LINKED-TYPE/CLASS|MANDATORY|READONLY|NOT-NULL|MIN |MAX |COLLATE|DEFAULT|
+----+------------+-----------------+---------+--------+--------+----+----+-------+-------+
|0   |created     |Action           |false    |false   |false   |    |    |default|       |
|1   |lastModified|Action           |false    |false   |false   |    |    |default|       |
|2   |deactivated |Action           |false    |false   |false   |    |    |default|       |
|3   |in          |Staffer          |true     |false   |true    |    |    |default|       |
|4   |roles       |STRING           |false    |false   |false   |    |    |default|       |
|5   |state       |                 |true     |false   |false   |    |    |default|P      |
|6   |out         |Account          |true     |false   |true    |    |    |default|       |
+----+------------+-----------------+---------+--------+--------+----+----+-------+-------+

INDEXES (1 altogether)
+----+---------------+----------+
|#   |NAME           |PROPERTIES|
+----+---------------+----------+
|0   |WorksFor.out_in|[in,out]  |
+----+---------------+----------+
orientdb {db=rehabowner.db}>

orientdb {db=rehabowner.db}> match {class: Account, as: a}-WorksFor-{class: Staffer, as: s} return s

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
match {class: Account, as: a}
                            ^
Encountered "<EOF>" at line 1, column 29.
Was expecting one of:
    <RETURN> ...
    "," ...
    "." ...
    "<" ...
    "--" ...
    "-" ...

        DB name="rehabowner.db"
        Error Code="1"
        DB name="rehabowner.db"

!Unrecognized command: '-WorksFor-{class: Staffer, as: s}'
!Unrecognized command: 'return s'
orientdb {db=rehabowner.db}>

orientdb {db=rehabowner.db}> MATCH {Class: Account, as: a} RETURN a;

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
match {Class: Account, as: a}
                            ^
Encountered "<EOF>" at line 1, column 29.
Was expecting one of:
    <RETURN> ...
    "," ...
    "." ...
    "<" ...
    "--" ...
    "-" ...

        DB name="rehabowner.db"
        Error Code="1"
        DB name="rehabowner.db"

!Unrecognized command: 'RETURN a'


@hrstoyanov
Copy link
Author

Could this be a because I have not compiled in any of the Gremlin stuff into the server?

@luigidellaquila
Copy link
Member

Hi @hrstoyanov

I think the problem is in the console, please try the queries from Studio, I'm pretty sure they work well.
I'll try to fix the problem asap

Thanks

Luigi

@luigidellaquila luigidellaquila self-assigned this Jul 19, 2018
luigidellaquila added a commit that referenced this issue Jul 19, 2018
@luigidellaquila
Copy link
Member

Hi @hrstoyanov

I just pushed a fix, it will be released with v 3.0.5

Thanks

Luigi

@luigidellaquila luigidellaquila added this to the 3.0.5 milestone Jul 19, 2018
@hrstoyanov
Copy link
Author

hrstoyanov commented Jul 19, 2018

Thanks @luigidellaquila ,

It seems the fix works, but still having other issues. I am stuck with my ODB-based project, due to issues like this, as well as: #8415, #8419, #8422.

I am very worried with the code quality of ODB 3 with issues like these!

When is 3.0.5 out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants