MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / contains_aggregate_function

Method contains_aggregate_function

graphlite/src/exec/executor.rs:2069–2090  ·  view source on GitHub ↗

Check if an expression contains aggregate functions

(&self, expr: &Expression)

Source from the content-addressed store, hash-verified

2067
2068 /// Check if an expression contains aggregate functions
2069 fn contains_aggregate_function(&self, expr: &Expression) -> bool {
2070 match expr {
2071 Expression::FunctionCall(func_call) => {
2072 // Check if this is an aggregate function
2073 matches!(
2074 func_call.name.to_uppercase().as_str(),
2075 "COUNT" | "AVG" | "SUM" | "MIN" | "MAX"
2076 )
2077 }
2078 Expression::Binary(binary) => {
2079 // Recursively check both operands
2080 self.contains_aggregate_function(&binary.left)
2081 || self.contains_aggregate_function(&binary.right)
2082 }
2083 Expression::Unary(unary) => {
2084 // Recursively check the expression
2085 self.contains_aggregate_function(&unary.expression)
2086 }
2087 // Other expression types don't contain aggregate functions
2088 _ => false,
2089 }
2090 }
2091
2092 /// Execute final RETURN clause with aggregation when needed
2093 fn execute_return_with_aggregation(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected