[Swift-commit] r5596 - provenancedb

lgadelha at ci.uchicago.edu lgadelha at ci.uchicago.edu
Mon Feb 13 09:44:20 CST 2012


Author: lgadelha
Date: 2012-02-13 09:44:20 -0600 (Mon, 13 Feb 2012)
New Revision: 5596

Modified:
   provenancedb/prov-init.sql
   provenancedb/prov-to-sql.sh
Log:
Minor updates.


Modified: provenancedb/prov-init.sql
===================================================================
--- provenancedb/prov-init.sql	2012-02-13 01:59:23 UTC (rev 5595)
+++ provenancedb/prov-init.sql	2012-02-13 15:44:20 UTC (rev 5596)
@@ -239,10 +239,9 @@
 
 drop view function_call;
 
--- TODO: move tc_name to application_execution (app_exec)
 create view function_call as 
     select proc.id, app_inv.proc_name as name, proc.type, proc.name as tc_name, proc.run_id as script_run_id,  
-           to_timestamp(app_inv.start_time), app_inv.duration, app_inv.final_state, app_inv.scratch 
+           to_timestamp(app_inv.start_time) as start_time, app_inv.duration, app_inv.final_state, app_inv.scratch 
     from proc 
     left outer join 
     app_inv on proc.id=app_inv.id;

Modified: provenancedb/prov-to-sql.sh
===================================================================
--- provenancedb/prov-to-sql.sh	2012-02-13 01:59:23 UTC (rev 5595)
+++ provenancedb/prov-to-sql.sh	2012-02-13 15:44:20 UTC (rev 5596)
@@ -25,6 +25,22 @@
     $SQLCMD -c  "INSERT INTO app_exec (id, app_inv_id, start_time, duration, final_state, site) VALUES ('$globalid', '$inv_id', $start_time, $duration, '$endstate', '$site');"
 done < execute2.global.event
 
+while read outer inner; do
+    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$outer');"
+    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$inner');"
+    $SQLCMD -c  "INSERT INTO ds_cont (out_id, in_id) VALUES ('$outer', '$inner');"
+done < tie-containers.txt
+
+while read dataset filename; do
+    $SQLCMD -c "INSERT INTO ds (id) VALUES ('$dataset');"
+    $SQLCMD -c "INSERT INTO file (id, name) VALUES ('$dataset', '$filename');"
+done < dataset-filenames.txt
+
+while read dataset idtype equal value rest; do
+    $SQLCMD -c "INSERT INTO ds (id) VALUES ('$dataset');"
+    $SQLCMD -c "INSERT INTO in_mem (id, value) VALUES ('$dataset', '$value');"
+done < dataset-values.txt
+
 while read col1 col2 col3 col4 col5 thread name lhs rhs result; do
     thread=$(echo $thread | awk 'BEGIN { FS = "=" }; {print $2}')
     name=$(echo $name | awk 'BEGIN { FS = "=" }; {print $2}')
@@ -34,15 +50,9 @@
     
     operatorid="${WFID}operator:$thread"
     
-    if [ $version -le 3726 ]; then
-	lhs=$(echo $lhs | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-	rhs=$(echo $rhs | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-	result=$(echo $result | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-  
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$lhs');"
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$rhs');"
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$result');"
+    #$SQLCMD -c  "INSERT INTO ds (id) VALUES ('$lhs');"
+    #$SQLCMD -c  "INSERT INTO ds (id) VALUES ('$rhs');"
+    #$SQLCMD -c  "INSERT INTO ds (id) VALUES ('$result');"
     $SQLCMD -c  "INSERT INTO proc (id, type, name, run_id) VALUES ('$operatorid', 'operator', '$name', '$WF');"
     $SQLCMD -c  "INSERT INTO ds_in (proc_id, ds_id, param) VALUES ('$operatorid', '$lhs', 'lhs');"
     $SQLCMD -c  "INSERT INTO ds_in (proc_id, ds_id, param) VALUES ('$operatorid', '$rhs', 'rhs');"
@@ -50,22 +60,13 @@
 done < operators.txt
 
 while read id name output; do
-    if [ $version -le 3726 ]; then
-	output=$(echo $output | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$output');"
+    #$SQLCMD -c  "INSERT INTO ds (id) VALUES ('$output');"
     $SQLCMD -c  "INSERT INTO proc (id, type, name, run_id) VALUES ('$id', 'function', '$name', '$WF');"
     $SQLCMD -c  "INSERT INTO ds_out (proc_id, ds_id, param) VALUES ('$id', '$output', 'result');"
 done < functions.txt
 
 while read id value; do
-    # TODO need ordering/naming
-
-    if [ $version -le 3726 ]; then
-	value=$(echo $value | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-    
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$value');"
+    #$SQLCMD -c  "INSERT INTO ds (id) VALUES ('$value');"
     $SQLCMD -c  "INSERT INTO ds_in (proc_id, ds_id, param) VALUES ('$id', '$value', 'undefined');"
 done < function-inputs.txt
 
@@ -74,38 +75,6 @@
     $SQLCMD -c  "UPDATE app_inv SET proc_name='$appname' WHERE id='$thread';"
 done < invocation-procedure-names.txt
 
-while read outer inner; do
-
-    if [ $version -le 3726 ]; then
-	outer=$(echo $outer | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-	inner=$(echo $inner | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$outer');"
-    $SQLCMD -c  "INSERT INTO ds (id) VALUES ('$inner');"
-    $SQLCMD -c  "INSERT INTO ds_cont (out_id, in_id) VALUES ('$outer', '$inner');"
-done < tie-containers.txt
-
-while read dataset filename; do
-
-    if [ $version -le 3726 ]; then
-	dataset=$(echo $dataset | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-
-    $SQLCMD -c "INSERT INTO ds (id) VALUES ('$dataset');"
-    $SQLCMD -c "INSERT INTO file (id, name) VALUES ('$dataset', '$filename');"
-done < dataset-filenames.txt
-
-while read dataset idtype equal value rest; do
-
-    if [ $version -le 3726 ]; then
-	dataset=$(echo $dataset | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-
-    $SQLCMD -c "INSERT INTO ds (id) VALUES ('$dataset');"
-    $SQLCMD -c "INSERT INTO in_mem (id, value) VALUES ('$dataset', '$value');"
-done < dataset-values.txt
-
 while read start duration wfid rest; do
     $SQLCMD -c "UPDATE run SET start_time=$start WHERE id='$WF';"
     $SQLCMD -c "UPDATE run SET duration=$duration WHERE id='$WF';"
@@ -133,11 +102,6 @@
 done < scopes.txt
 
 while read thread direction dataset variable rest; do 
-
-    if [ $version -le 3726 ]; then
-	dataset=$(echo $dataset | sed -e 's/tag:benc at ci.uchicago.edu,2008:swift://g')
-    fi
-
     if [ "$direction" == "input" ] ; then
 	table=ds_in
     else




More information about the Swift-commit mailing list