-
Notifications
You must be signed in to change notification settings - Fork 871
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
Incorrect result of function #8811
Comments
How I can get result of the query by function ? |
The https://orientdb.com/docs/2.0/orientdb.wiki/Functions.html#usage-via-java-api don't work correctly. |
Hi @schernolyas I think the function is working fine, the problem is the way you are using it. The solution is to expand the result of the function as follows:
I hope it helps Thanks Luigi |
Hi @luigidellaquila ! orientdb {db=test}> select findv(#29:0) +----+------------+ 1 item(s) found. Query executed in 0.014 sec(s). 0 item(s) found. Query executed in 0.003 sec(s). Nothing :-( |
@luigidellaquila +----+-----+------+------------+----------+ 1 item(s) found. Query executed in 0.008 sec(s). |
OrientDB Version: 3.0.17
Java Version: Java 8
OS: Ubuntu
Expected behavior
function returns collection of @Rid insteed objects
Actual behavior
function must return result objects
Steps to reproduce
I have function:
return orient.getDatabase().query("select expand(outE(?).inV()) from " + fromRID)
The function is developed by JS.
orientdb {db=test}> select expand(outE(?).inV()) from #29:0
+----+-----+------+------+---------+
|# |@Rid |@Class|title |in_Author|
+----+-----+------+------+---------+
|0 |#33:0|Book |Ivahoe|[#37:0] |
+----+-----+------+------+---------+
but function returns:
orientdb {db=test}> select findv(#29:0)
+----+------------+
|# |findv(#29:0)|
+----+------------+
|0 |[#33:0] |
+----+------------+
Content of table OFuction:
orientdb {db=test}> select from OFunction;
+----+----+---------+----------+---------+----------+---------------------------------------------------------------------------------+----------+
|# |@Rid|@Class |idempotent|name |language |code |parameters|
+----+----+---------+----------+---------+----------+---------------------------------------------------------------------------------+----------+
|0 |#6:0|OFunction| |getNumber|groovy |return 1; | |
|1 |#6:1|OFunction| |findV |javascript|return orient.getDatabase().query("select expand(outE(?).inV()) from " + fromRID)|[fromRID] |
+----+----+---------+----------+---------+----------+---------------------------------------------------------------------------------+----------+
The text was updated successfully, but these errors were encountered: