aws / amazon-neptune-jdbc-driver

Amazon Neptune JDBC Driver by Amazon Web Services
https://aws.amazon.com/neptune/
Apache License 2.0
23 stars 13 forks source link

[BUG] Unable to query for Vertices by presence or absence of an incoming vertex #260

Open aSapien opened 2 months ago

aSapien commented 2 months ago

Describe the bug

When querying for vertices that DO have an incoming edge, results are returned with empty list in the _IN_ID column (see screenshot):

select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> ''; -- returns all MyVertex vertices
select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> '[]'; -- also returns all MyVertex vertices

When trying to find vertices that DON't have such an incoming edge, not vertices are returned at all:

select * from MyVertex as mv where mv.MY_EDGE_IN_ID = ''; -- returns nothing
select * from MyVertex as mv where mv.MY_EDGE_IN_ID = '[]'; -- also nothing

Steps to Reproduce

If being used outside of a BI Tool, fill in:
1. What version of the JDBC Driver are you using?   3.0.3
2. What language variant are you using (SPARQL, Gremlin, openCypher, SQL)? SQL
3. What database are you connecting to (Amazon Neptune, Neo4J, etc)? Neptune
4. What engine version of the database are you using? 1.2.1.0 (Serverless)
5. What Java version are you using? `17.0.11+1`
6. Please attach a code snippet of the code that is causing the error
select * from MyVertex as mv where mv.MY_EDGE_IN_ID = ''; 
select * from MyVertex as mv where mv.MY_EDGE_IN_ID = '[]';
select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> '';
select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> '[]';
8. If bug occurred during query execution attach the SQL
select * from MyVertex as mv where mv.MY_EDGE_IN_ID = ''; 
select * from MyVertex as mv where mv.MY_EDGE_IN_ID = '[]';
select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> '';
select * from MyVertex as mv where mv.MY_EDGE_IN_ID <> '[]';
9. Attach debug logs if applicable/possible (please ensure it doesn't contain any sensitive information)

Expected behavior

Should be able to query vertices by presence or absence of an edge connection.

Screenshots

image

Environment

Additional Context