Added asterix project

git-svn-id: https://asterixdb.googlecode.com/svn/trunk/asterix@12 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/AQLTS/queries/functionDecl1.aql b/asterix-app/src/test/resources/AQLTS/queries/functionDecl1.aql
new file mode 100644
index 0000000..2b24cc0
--- /dev/null
+++ b/asterix-app/src/test/resources/AQLTS/queries/functionDecl1.aql
@@ -0,0 +1,17 @@
+declare function calculate($events){
+for $event in $events
+for $sponsor in $event.sponsoring_sigs
+let $es := { "event": $event, "sponsor": $sponsor }
+group by $sig_name := $sponsor.sig_name with $es
+let $sig_sponsorship_count := count($es)
+let $by_chapter :=
+   for $e in $es
+   group by $chapter_name := $e.sponsor.chapter_name with $es
+   return { "chapter_name": $chapter_name, "escount" : count($es) }
+order by $sig_sponsorship_count desc
+limit 5
+return { "sig_name": $sig_name, "total_count": $sig_sponsorship_count, "chapter_breakdown": $by_chapter }
+}
+
+let $result := calculate(dataset('Events'))
+return $result
\ No newline at end of file