Skip to content

How to add new queries #1

@haozixu

Description

@haozixu

Hi, I tried to add some self-defined queries and run the program on GPU (using algorithm type GPU_LIGHT). Following the instructions, I registered my query type in src/Meta.h and added query pattern with orderings in src/query/common/Query.h. class LazyTraversalPlanHardCode in src/optimizer/LazyTraversalPlanHardCode.h was also modified (if not, some assertions will fail). But it turned out that the answers (count) seemed to be incorrect. Am I missing some steps or did something wrong? Thanks.

My query code:

void MyQuery() {
    vertex_count_ = 6;

    con_.resize(vertex_count_);
    con_[0].push_back(1);
    con_[0].push_back(2);
    con_[0].push_back(3);
    con_[0].push_back(4);
    con_[0].push_back(5);
    con_[1].push_back(0);
    con_[1].push_back(2);
    con_[2].push_back(0);
    con_[2].push_back(1);
    con_[2].push_back(3);
    con_[2].push_back(4);
    con_[2].push_back(5);
    con_[3].push_back(0);
    con_[3].push_back(2);
    con_[3].push_back(4);
    con_[4].push_back(0);
    con_[4].push_back(2);
    con_[4].push_back(3);
    con_[4].push_back(5);
    con_[5].push_back(0);
    con_[5].push_back(2);
    con_[5].push_back(4);

    order_.resize(vertex_count_);
    order_[0].push_back(std::make_pair(LESS_THAN, 1));
    order_[3].push_back(std::make_pair(LESS_THAN, 4));
    order_[1].push_back(std::make_pair(LARGER_THAN, 0));
    order_[4].push_back(std::make_pair(LARGER_THAN, 3));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions