Commit 11735ed6 authored by Sylvain Schmitz's avatar Sylvain Schmitz

count aggregation with count()

parent 7f9e8381
#!/bin/bash
echo "<count>"
sum=0
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
if [[ $filename = *"-full.xml" || $filename = "w3c.xml" || $filename = "xpathmark.xml" ]]; then
value=$(xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[ast//xqx:functionName[text()='count']])" $FILE)
sum=$(($sum+$value))
echo " <source @name='$filename'>$value</source>"
fi
done
echo " <total>$sum</total>"
echo "</count>"
echo "<countcst>"
printf "%'.0f" $sum > count-aggregation.tex
sum=0
for FILE in ../../benchmark/*-full.xml
do
filename=$(basename "$FILE")
if [[ $filename = *"-full.xml" || $filename = "w3c.xml" || $filename = "xpathmark.xml" ]]; then
value=$(xmlstarlet sel -N xqx="http://www.w3.org/2005/XQueryX" -t -c "count(/benchmark/xpath[descendant::*[(local-name()='ltOp' or local-name()='leOp' or local-name()='gtOp' or local-name()='geOp' or local-name()='eqOp' or local-name()='neOp' or local-name()='equalOp' or local-name()='notEqualOp' or local-name()='lessThanOp' or local-name()='lessThanOrEqualOp' or local-name()='greaterThanOp' or local-name()='greaterThanOrEqualOp') and ((xqx:firstOperand | xqx:secondOperand)/xqx:functionCallExpr/xqx:functionName[text()='count']) and ((xqx:firstOperand | xqx:secondOperand)/xqx:integerConstantExpr)]])" $FILE)
sum=$(($sum+$value))
echo " <source @name='$filename'>$value</source>"
fi
done
echo " <total>$sum</total>"
echo "</countcst>"
printf "%'.0f" $sum > count-aggregation-cst.tex
......@@ -25,6 +25,9 @@ echo ""
echo "<!-- Number of queries using id -->"
bash id.sh
echo ""
echo "<!-- Number of queries with counts -->"
bash aggregation.sh
echo ""
echo "<!-- Number of queries with arbitrary use of variables -->"
bash var.sh
echo ""
......
Markdown is supported
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