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

Function test_parser_with_clause_aggregation

graphlite/src/ast/parser.rs:5512–5531  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5510
5511#[test]
5512fn test_parser_with_clause_aggregation() {
5513 let query = "MATCH (a:Account)-[t:Transaction]->(m:Merchant)
5514 WITH a, m, count(t) as transaction_count, sum(t.amount) as total_spent
5515 WHERE transaction_count > 5
5516 MATCH (m)<-[:Transaction]-(other:Account)
5517 WHERE other <> a
5518 RETURN a.account_number,
5519 m.name,
5520 transaction_count,
5521 total_spent,
5522 count(DISTINCT other) as fellow_customers
5523 ORDER BY total_spent DESC
5524 LIMIT 10";
5525 let result = parse_query(query);
5526 assert!(
5527 result.is_ok(),
5528 "WITH clause with aggregation should parse. Error: {:?}",
5529 result.err()
5530 );
5531}
5532
5533#[test]
5534fn test_parser_simple_with_clause() {

Callers

nothing calls this directly

Calls 1

parse_queryFunction · 0.85

Tested by

no test coverage detected