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

SQL: "$current" variable not working correctly in subqueries #1825

Open
gramian opened this issue Nov 12, 2024 · 0 comments
Open

SQL: "$current" variable not working correctly in subqueries #1825

gramian opened this issue Nov 12, 2024 · 0 comments

Comments

@gramian
Copy link
Collaborator

gramian commented Nov 12, 2024

ArcadeDB Version:

ArcadeDB Server v24.11.1 (build b466f487e42fbb39fd20965004ce88682335eaba/1730841732933/main)

OS and JDK Version:

Running on Linux 6.2.0-26-generic - OpenJDK 64-Bit Server VM 17.0.12

Expected behavior

Using the $parent.$current variables in subqueries should work.

Actual behavior

Both separately or in combination seem to be ignored? No results are returned.

Using $parent.$current as FROM target gives:

Error on command execution (PostCommandHandler): class com.arcadedb.query.sql.executor.ResultInternal cannot be cast to class java.util.Collection (com.arcadedb.query.sql.executor.ResultInternal is in unnamed module of loader 'app'; java.util.Collection is in module java.base of loader 'bootstrap')

Using $parent.$current.@rid as FROM target gives no result, ie []:

Steps to reproduce

Setup:

CREATE DOCUMENT TYPE doc;
INSERT INTO doc SET a = 0;

Test:

SELECT a FROM #1:0; -- {"a":0}
SELECT @rid, (SELECT a FROM #1:0; -- works: [{"a":0}]
SELECT @rid, (SELECT a FROM $parent.$current); -- error, see above
SELECT @rid, (SELECT a FROM $parent.$current.@rid); -- empty result

Note:

This issue #883 may be related

@gramian gramian changed the title SQL: "$current" variable are not working correctly in subqueries SQL: "$current" variable not working correctly in subqueries Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant