15#ifndef PROVENANCE_EVALUATE_COMPILED_HPP
16#define PROVENANCE_EVALUATE_COMPILED_HPP
19#include "executor/spi.h"
53 std::unordered_map<gate_t, T> &provenance_mapping,
54 const std::function<T(
const char *)> &charp_to_value,
58 for (uint64 i = 0; i < SPI_processed; i++) {
59 HeapTuple tuple = SPI_tuptable->vals[i];
60 TupleDesc tupdesc = SPI_tuptable->tupdesc;
68 char *value = SPI_getvalue(tuple, tupdesc, 1);
69 char *uuid = SPI_getvalue(tuple, tupdesc, 2);
71 provenance_mapping[c.
getGate(uuid)]=charp_to_value(value);
Build in-memory circuits from the mmap-backed persistent store.
Out-of-line template method implementations for Circuit<gateType>.
Exception type thrown by circuit operations on invalid input.
gate_t getGate(const uuid &u)
Return (or create) the gate associated with UUID u.
In-memory provenance circuit with semiring-generic evaluation.
void initialize_provenance_mapping(const constants_t &constants, GenericCircuit &c, std::unordered_map< gate_t, T > &provenance_mapping, const std::function< T(const char *)> &charp_to_value, bool drop_table)
Populate a provenance mapping from the current SPI result set.
const char * drop_temp_table
DROP TABLE statement for the per-query temporary provenance mapping table.
C++ utility functions for UUID manipulation.
Structure to store the value of various constants.
Oid OID_TYPE_UUID
OID of the uuid TYPE.