Commit b393d3f3 authored by Haoyu Z's avatar Haoyu Z
Browse files

debug

parent f1fda95b
......@@ -11,8 +11,7 @@ import traceback
#When craeting the auxillary provenance tables, need to add a column called provtuple, which is a sorted array
#[t1, t2, t3...]
#cur.execute("select add_provenance('{}');".format(table1))
#cur.execute("select create_provenance_mapping('{}_{}_mapping','{}','{}');".format(table1, subject, table1, subject))
tablesWithProvenance = {}
def tablesInQuery(query):
parsed = sp.parse(query)[0]
......@@ -53,6 +52,8 @@ def preprocess_query(query, cur, conn):
tables = tablesInQuery(query)
output = []
for table in tables:
if table in tablesWithProvenance:
continue
command1 = "select add_provenance('{}');".format(table)
command2 = "select create_provenance_mapping('{}_provtuple_mapping','{}','provtuple');".format(table, table)
ut.commitAndExecute(conn, cur, command1)
......@@ -61,6 +62,7 @@ def preprocess_query(query, cur, conn):
index = query.find('select') + 6
tmp = query[:index] + formula + query[index:]
output.append(tmp)
tablesWithProvenance[table] = 1
return (tables,output)
#formulas:[[formula1, formula2, ...],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment