MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / build_algebraic_expression

Function build_algebraic_expression

tests/unit/test_algebraic_expression.c:183–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183AlgebraicExpression **build_algebraic_expression(const char *query, AST **master_ast) {
184 cypher_parse_result_t *parse_result = cypher_parse(query, NULL, NULL, CYPHER_PARSE_ONLY_STATEMENTS);
185 *master_ast = AST_Build(parse_result);
186 AST *ast = AST_NewSegment(*master_ast, 0, cypher_ast_query_nclauses((*master_ast)->root));
187 QueryGraph *qg = BuildQueryGraph(ast);
188 AlgebraicExpression **ae = AlgebraicExpression_FromQueryGraph(qg);
189 _AlgebraicExpression_RemoveRedundentOperands(ae, qg);
190
191 uint exp_count = array_len(ae);
192 for(uint i = 0; i < exp_count; i++) {
193 AlgebraicExpression_Optimize(ae + i);
194 }
195
196 QueryGraph_Free(qg);
197 AST_Free(ast);
198
199 return ae;
200}
201
202void _print_matrix(GrB_Matrix mat) {
203 GrB_Index ncols, nrows, nvals;

Callers 9

test_BothDirectionsFunction · 0.85
test_SingleNodeFunction · 0.85
test_ShareableEntityFunction · 0.85
test_VariableLengthFunction · 0.85
test_ExpressionExecuteFunction · 0.85

Calls 9

AST_BuildFunction · 0.85
AST_NewSegmentFunction · 0.85
BuildQueryGraphFunction · 0.85
array_lenFunction · 0.85
QueryGraph_FreeFunction · 0.85
AST_FreeFunction · 0.85

Tested by

no test coverage detected