Skip to content

Commit

Permalink
Script to produce paper table count for schema annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
KinanBab committed May 23, 2023
1 parent 024d5da commit e524006
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions experiments/schema-annot/annotated/count.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
for f in *.sql; do
tbls=$(grep -i -R -E "CREATE (DATA_SUBJECT )?TABLE" $f | grep -E -v "^\s*--" | wc -l)
ds=$(grep -i -R -E "CREATE DATA_SUBJECT TABLE" $f | grep -E -v "^\s*--" | wc -l)
own=$(grep -i -R -E " (OWNED_BY|OWNS) " $f | grep -E -v "^\s*--" | wc -l)
acc=$(grep -i -R -E " (ACCESSED_BY|ACCESSES) " $f | grep -E -v "^\s*--" | wc -l)
anon=$(grep -i -R -E "ON (GET|DEL) .* ANON \(" $f | grep -E -v "^\s*--" | wc -l)
prefix=(${f//-/ })
prefix=${prefix[0]}
prefix=(${prefix//_/ })
prefix=${prefix[0]}
printf "\\\\%-20s & %-6s & %-9s & %-3s & %-6s & %-5s \\\\\\ \\hline" $prefix $tbls $ds $own $acc $anon
echo ""
done

0 comments on commit e524006

Please sign in to comment.