In order to debug a query that I’m writing, I’d like to be able to display the content of the vertices that have been traversed.
I’m using something like this:
CREATE QUERY test(Vertex Src) FOR GRAPH fraud_detection_network {
BOOL debug = TRUE;
start = {Src};
WHILE start.size() > 0 limit 10 DO
start = SELECT v
FROM start: s - (:e) -> :v
ACCUM
// some logic...
POST-ACCUM
LOG(debug,v);
END;
}
Just to finish off. Nope. I wasn’t suggesting the log approach, if you are specifically looking to apply the logging function, then MingXi’s solution is the only way I know of.
Given your routine doesn’t return any values, I meant to use the actual print function after the select block was complete. That works fine with vset’s.
CREATE QUERY test(Vertex Src) FOR GRAPH fraud_detection_network {
BOOL debug = TRUE;
ListAccum<Vertex> @@log_vertices;
start = {Src};
WHILE start.size() > 0 limit 10 DO
start = SELECT v
FROM start: s - (:e) -> :v
POST-ACCUM
@@log_vertices += v
END;
myVset = {@@log_vertices};
print myVset;
}
Gotcha
Yeah - I was specifically looking for a way to “debug” each iteration of an algorithm, so I wanted to inspect how each iteration effects the aggregators.