Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
haoyuz3
SQL Provenance
Commits
f3b5d188
Commit
f3b5d188
authored
Sep 30, 2020
by
Haoyu Z
Browse files
version 2.1: add provtuple column to table
parent
c4f89093
Changes
1
Hide whitespace changes
Inline
Side-by-side
provsql/src/provenance.py
View file @
f3b5d188
...
...
@@ -53,6 +53,7 @@ def preprocess_query(query, cur, conn):
output
=
[]
for
table
in
tables
:
if
table
not
in
tablesWithProvenance
:
cmdAddProvtuple
=
"select 'add_provtuple'({})"
.
format
(
table
)
command1
=
"select add_provenance('{}');"
.
format
(
table
)
command2
=
"select create_provenance_mapping('{}_provtuple_mapping','{}','provtuple');"
.
format
(
table
,
table
)
ut
.
commitAndExecute
(
conn
,
cur
,
command1
)
...
...
@@ -113,18 +114,15 @@ def exe_query(query, out_file, cur, conn):
else
:
formulas
[
i
].
append
(
tu
[
0
])
print
(
"formulas"
,
formulas
)
processed_formulas
=
[]
for
fs
in
formulas
:
rowformula
=
process_formula
(
fs
,
tables
)
processed_formulas
.
append
(
rowformula
)
print
(
"processed formula"
,
processed_formulas
)
result__
=
[]
for
i
,
row
in
enumerate
(
result_t
):
rowl
=
list
(
row
)
rowl
[
0
]
=
processed_formulas
[
i
]
result__
.
append
(
rowl
)
print
(
"result"
,
result__
)
# Combine rows with same output
result
=
ut
.
combineSameRow
(
result__
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment