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

function on field names does not work when the nGQL starts with 'LOOKUP' #5341

Closed
xiaominyan88 opened this issue Feb 14, 2023 · 3 comments
Closed
Labels
affects/none PR/issue: this bug affects none version. severity/none Severity of bug

Comments

@xiaominyan88
Copy link

Cluster Config
metad: 3
graphd: 6
storaged: 6

Space Config
VID: FIXED_STRING(30)
Replica factor: 1
Partition Num: 30

Problem
When the nGQL starts with 'LOOKUP' and threre are some functions on field names after WHERE condition, such as:

LOOKUP ON comment WHERE timestamp(head(split(comment.creationDate,"."))) < 1304208000000 YIELD id(vertex) AS vid

the error occurs:

-1009:SemanticError: Expression (timestamp(head(split(comment.creationDate,".")))<1304208000000) not supported yet

However, when I modify the nGQL with 'GO', such as:

GO FROM "15393162822759" OVER comment_hasCreator_person REVERSELY WHERE timestamp(head(split(properties($$).creationDate,"."))) < 1304208000000 YIELD id($$) AS vid

the nGQL works well, it seems that there are differences on function process between 'GO' and 'LOOKUP'

@xiaominyan88 xiaominyan88 added the type/bug Type: something is unexpected label Feb 14, 2023
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Feb 14, 2023
@QingZ11
Copy link
Contributor

QingZ11 commented Feb 16, 2023

what's your nebulagraph core version?

@wey-gu
Copy link
Contributor

wey-gu commented Feb 16, 2023

For the lookup query, it's a typical tabular query(or, not a graphy one), that is, when we are query data with LOOKUP, it's a duplicated data on given tag/edgetype stored in a tabular way(like RDBMS), and NebulaGraph is not designed for such purposes.

Thus, the expression like timestamp(head(split(comment.creationDate,"."))) < 1304208000000 in LOOKUP means to actually fetch all "rows" of comment TAG's creationDate column from storaged(s) to graphd then evaluate the outer layers(function split, head, timestamp). Whereas for some other expression like comment.creationDate < "2021-01-02", it could be translated to a underlying prefix scan, thus the filter could be applied(push down) to storaged when scaning the index data.

While in GO case, the filter expression can be done as it's just filtering on top of one graph traversal fetched data, thus in such volume of data(one hop graph traversal v.s. full scan of tag:comment), it's allowed and acceptable.

Actually, the GO case with comment.creationDate < "2021-01-02" might be more efficency(not yet verified but could be) as the filter could be pushed down during the traversal, too.

@xtcyclist xtcyclist removed the type/bug Type: something is unexpected label Feb 27, 2023
@xtcyclist
Copy link
Contributor

xtcyclist commented Feb 27, 2023

This is not a bug, as explained by @wey-gu. Close this issue for now.

If you want more functions from LOOKUP, please issue some feature requests. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/none PR/issue: this bug affects none version. severity/none Severity of bug
Projects
None yet
Development

No branches or pull requests

4 participants