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

Function AR_EXP_CollectAttributes

src/arithmetic/arithmetic_expression.c:745–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745void AR_EXP_CollectAttributes(AR_ExpNode *root, rax *attributes) {
746 if(AR_EXP_IsOperation(root)) {
747 if(strcmp(AR_EXP_GetFuncName(root), "property") == 0) {
748 AR_ExpNode *arg = root->op.children[1];
749 ASSERT(AR_EXP_IsConstant(arg));
750 ASSERT(SI_TYPE(arg->operand.constant) == T_STRING);
751
752 const char *attr = arg->operand.constant.stringval;
753 raxInsert(attributes, (unsigned char *)attr, strlen(attr), NULL, NULL);
754 }
755
756 // continue scanning expression
757 for(int i = 0; i < root->op.child_count; i ++) {
758 AR_EXP_CollectAttributes(root->op.children[i], attributes);
759 }
760 }
761}
762
763bool AR_EXP_ContainsAggregation(AR_ExpNode *root) {
764 if(AGGREGATION_NODE(root)) return true;

Callers 1

Calls 3

AR_EXP_IsOperationFunction · 0.85
AR_EXP_GetFuncNameFunction · 0.85
AR_EXP_IsConstantFunction · 0.85

Tested by

no test coverage detected