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

debug

parent b393d3f3
......@@ -52,17 +52,17 @@ 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)
ut.commitAndExecute(conn, cur, command2)
if table not in tablesWithProvenance:
command1 = "select add_provenance('{}');".format(table)
command2 = "select create_provenance_mapping('{}_provtuple_mapping','{}','provtuple');".format(table, table)
ut.commitAndExecute(conn, cur, command1)
ut.commitAndExecute(conn, cur, command2)
tablesWithProvenance[table] = 1
formula = " formula(provenance(), '{}_provtuple_mapping'), ".format(table)
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