Write an interpreter that interprets the query as such (on a mega node with access to all tuples). Feed a stream of random packets to this interpreter and compare the output with the output from feeding the same packets to the generated P4 or Domino code.