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

Disable .is(neq(' cypher.null')) Gremlin token for Cyphter statements that contains WITH clause #342

Open
sbespalov opened this issue Dec 9, 2019 · 7 comments

Comments

@sbespalov
Copy link

sbespalov commented Dec 9, 2019

I have following Cyphter statement:

MATCH (n:`RepositoryArtifactIdGroup`)  
WHERE n.`uuid` = '364be4ec-6d2f-464a-bad0-1e0a65241cd5'  
WITH n 
MATCH (n)-[r_r1:`RepositoryArtifactIdGroupEntity_ArtifactGroupEntity`]->(a1:`ArtifactGroup`) 
WITH n, r_r1, a1 
RETURN n, r_r1, a1

This statement produce following Gremlin query:

g.V()
    .as('n')
    .hasLabel('RepositoryArtifactIdGroup')
    .has('uuid', eq('a707bad0-bb6a-4308-a7aa-f8d7b4f7cf2a'))
    .as('n')
    .is(neq('  cypher.null'))
    .outE('RepositoryArtifactIdGroupEntity_ArtifactGroupEntity')
    .as('r_r1')
    .inV()
    .as('a1')
    .hasLabel('ArtifactGroup')
    .select('n', 'r_r1', 'a1')
    .project('n', 'r_r1', 'a1')
    .by(__.select('n')).by(__.select('r_r1')).by(__.select('a1')).as('  GENERATED4')
    .select('n').as('n').select('  GENERATED4')
    .select('r_r1').as('r_r1')
    .select('  GENERATED4')
    .select('a1').as('a1')
    .select('n', 'r_r1', 'a1')
    .project('n', 'r_r1', 'a1')
    .by(__.select('n').valueMap().with('~tinkerpop.valueMap.tokens'))
    .by(__.select('r_r1')
    .project('  cypher.element', '  cypher.inv', '  cypher.outv')
    .by(__.valueMap()
    .with('~tinkerpop.valueMap.tokens'))
    .by(__.inV().id()
    ).by(__.outV().id()))
    .by(__.select('a1').valueMap().with('~tinkerpop.valueMap.tokens'))

There is also index on uuid property for RepositoryArtifactIdGroup vertex in JanusGraph, so I expect this query should trigger this index.

The problem is that for some reason index not triggered directly this way, but it works fine without .is(neq(' cypher.null')) token. I am not sure does it JanusGrapth issue or not but however it will be good to optionally disable this cypher.null to be generated.

Is it possible to have such option?

@sbespalov
Copy link
Author

such option will also make possible to avoid parameters in-lining which mentioned here

@sbespalov
Copy link
Author

@dwitry could you please share your thoughts on this?

@carlspring
Copy link

Any updates on this? Please, advise!

@steve-todorov
Copy link

Hey @dwitry, have you had a chance to have a look at this yet? :)

@dwitry
Copy link
Contributor

dwitry commented Mar 24, 2020

@sbespalov @steve-todorov This change requires either implementing optimization strategy or introduce an inlining option. Both of these changes require significant efforts in development and testing. Currently, all my attention is focused on other areas, and I can not provide any terms when this could be implemented. The best I can do is review and merge PR if there are any volunteers.

@carlspring
Copy link

@dwitry ,

Thanks for your reply! Would it be possible to outline the list of tasks that you think would be required in order to implement/fix this?

@panxianglei
Copy link

有人怎么解决的吗?求分享下了。

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

5 participants