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

Empty OData content on TRAVERSE query. #41

Open
odiel opened this issue Aug 18, 2015 · 4 comments
Open

Empty OData content on TRAVERSE query. #41

odiel opened this issue Aug 18, 2015 · 4 comments
Labels

Comments

@odiel
Copy link

odiel commented Aug 18, 2015

Hi

I'm, having an issue since I upgraded to v1.2.0.

When executing a query like this one:

TRAVERSE out('hasParents') FROM (SELECT out('hasParents') FROM #49:3243757

I get two records when I query OrientDB from the UI, when using PHPOrient I get the same 2 records but the second record has no OData content, instead it has an empty array.

@ghost
Copy link

ghost commented Sep 28, 2015

+1

Same here, for example:
$client->query('traverse both() from (traverse bothE() from (select from Artist where title="U2" LIMIT 1) ) limit 24');
shows 1st element as expected, second and the rest won't have oData, oClass, version, etc., just the RIDs.

OrientDB v2.1.0

@Ostico
Copy link
Owner

Ostico commented Oct 4, 2015

Hi @odiel , @oharlem

i tried with the database GratefulDeadConcerts with this query:
"traverse both() from ( traverse bothE() from ( select from V where name='BERTHA' LIMIT 1 ) )"

and it worked as expected.
Could you provide more info or a data test set?

@Ostico
Copy link
Owner

Ostico commented Oct 4, 2015

I found what you say.

Investigating

@Ostico
Copy link
Owner

Ostico commented Oct 4, 2015

I found some interesting things.

When the SQL method TRAVERSE is called from $client->query method OrientDB returns only the first row with $classId === 0, it returns all other rows with $classId === -3

@see
https://github.com/Ostico/PhpOrient/blob/master/src/PhpOrient/Protocols/Binary/Abstracts/Operation.php#L497

so the oData content is never sent to the client after the first record.

I obtained what you want by using ASYNC query type with LIMIT = -1 param:

$result = $client->queryAsync( "traverse both() from ( traverse bothE() from ( select from V where name='BERTHA' LIMIT 1 ) )", [ 'limit' => -1 ] );

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

No branches or pull requests

2 participants