code review: added tests for issue 29,55,134,166,201,205,208
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_printerfix_staging@968 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
new file mode 100644
index 0000000..e0a0695
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : This test case is to verify the fix for issue205
+ : https://code.google.com/p/asterixdb/issues/detail?id=205
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmployeeStat as open {
+ age: int32,
+ salary:int32
+}
+
+create type EmployeeType as closed {
+ id:string,
+ stat:EmployeeStat,
+ deptCode:int32
+}
+
+create dataset Employees(EmployeeType)
+ partitioned by key id;
+
+insert into dataset Employees({"id":"1234", "stat":{ "age":50, "salary":120000}, "deptCode":32 });
+insert into dataset Employees({"id":"5678", "stat":{ "age":40, "salary":100000}, "deptCode":16 });
+
+delete $l from dataset Employees where $l.id = "1234";
+
+write output to nc1:"rttest/dml_query-issue205.adm";
+for $l in dataset('Employees')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
new file mode 100644
index 0000000..62a9ed8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue134
+ : https://code.google.com/p/asterixdb/issues/detail?id=134
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue134.adm";
+
+let $a:=true
+return {{[1,2,3,4,5],[6,5,3,8,9],[44,22,66,-1,0,99.9]}}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
new file mode 100644
index 0000000..aa0d13b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue166
+ : https://code.google.com/p/asterixdb/issues/detail?id=166
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue166.adm";
+
+let $a := [[1,2,3],[4,5,6,7]]
+return $a[1]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
new file mode 100644
index 0000000..e46286c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
@@ -0,0 +1,45 @@
+/*
+ * Description : This test case is to verify the fix for issue208
+ : https://code.google.com/p/asterixdb/issues/detail?id=208
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse OpenSocialNetworkData if exists;
+create dataverse OpenSocialNetworkData;
+
+use dataverse OpenSocialNetworkData;
+
+create type TwitterUserType as open {
+screen-name: string,
+lang: string,
+friends_count: int32,
+statuses_count: int32,
+name: string,
+followers_count: int32
+}
+
+create type TweetMessageType as open {
+tweetid: string,
+tweetid-copy: string,
+send-time-copy: datetime
+}
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+load dataset TweetMessages
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
+
+write output to nc1:"rttest/open-closed_query-issue208.adm";
+for $t in dataset('TweetMessages')
+where $t.send-time >= datetime('2005-04-13T17:17:22') and
+$t.send-time <= datetime('2011-04-13T17:18:22')
+group by $uid := $t.user.screen-name with $t
+order by $uid
+return {
+ "user": $uid,
+ "count": count($t)
+}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
new file mode 100644
index 0000000..8b778ba
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
@@ -0,0 +1,70 @@
+/*
+ * Description : This test case is to verify the fix for issue29
+ : https://code.google.com/p/asterixdb/issues/detail?id=29
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue29.adm";
+
+let $tweets :=
+{{
+ {
+ "tweetid": "1023",
+ "user": {
+ "screen-name": "dflynn24",
+ "lang": "en",
+ "friends_count": 46,
+ "statuses_count": 987,
+ "name": "danielle flynn",
+ "followers_count": 47
+ },
+ "sender-location": "40.904177,-72.958996",
+ "send-time": "2010-02-21T11:56:02-05:00",
+ "referred-topics": {{ "verizon" }},
+ "message-text": "i need a #verizon phone like nowwwww! :("
+ },
+ {
+ "tweetid": "1024",
+ "user": {
+ "screen-name": "miriamorous",
+ "lang": "en",
+ "friends_count": 69,
+ "statuses_count": 1068,
+ "name": "Miriam Songco",
+ "followers_count": 78
+ },
+ "send-time": "2010-02-21T11:11:43-08:00",
+ "referred-topics": {{ "commercials", "verizon", "att" }},
+ "message-text": "#verizon & #att #commercials, so competitive"
+ },
+ {
+ "tweetid": "1025",
+ "user": {
+ "screen-name": "dj33",
+ "lang": "en",
+ "friends_count": 96,
+ "statuses_count": 1696,
+ "name": "Don Jango",
+ "followers_count": 22
+ },
+ "send-time": "2010-02-21T12:38:44-05:00",
+ "referred-topics": {{ "charlotte" }},
+ "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales"
+ },
+ {
+ "tweetid": "1026",
+ "user": {
+ "screen-name": "reallyleila",
+ "lang": "en",
+ "friends_count": 106,
+ "statuses_count": 107,
+ "name": "Leila Samii",
+ "followers_count": 52
+ },
+ "send-time": "2010-02-21T21:31:57-06:00",
+ "referred-topics": {{ "verizon", "at&t", "iphone" }},
+ "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!"
+ }
+}}
+return $tweets
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
new file mode 100644
index 0000000..11b75d1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 1
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55-1.adm";
+
+let $l := [1.1f, 1.0f, 1.2f, 0.9, 1.3, 1, 2]
+for $i in $l
+for $j in $l
+return [$i, $j, "=", $i = $j, "<", $i < $j, "<=", $i <= $j, ">", $i > $j, ">=", $i >= $j]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
new file mode 100644
index 0000000..b4e4572
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 2
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55.adm";
+
+for $x in [[1,3],[4,5,2],[-1,-3,0],["a"]]
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
new file mode 100644
index 0000000..0505179
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : This test case is to verify the fix for issue201
+ : https://code.google.com/p/asterixdb/issues/detail?id=201
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
+
+let $x:=range(1,100)
+for $i in $x
+return $i
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm b/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm
new file mode 100644
index 0000000..ea80112
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/query-issue205.adm
@@ -0,0 +1 @@
+{ "id": "5678", "stat": { "age": 40, "salary": 100000 }, "deptCode": 16 }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm
new file mode 100644
index 0000000..0d06066
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue134.adm
@@ -0,0 +1 @@
+{{ [ 1, 2, 3, 4, 5 ], [ 6, 5, 3, 8, 9 ], [ 44, 22, 66, -1, 0, 99.9d ] }}
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm
new file mode 100644
index 0000000..b5897af
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue166.adm
@@ -0,0 +1 @@
+[ 4, 5, 6, 7 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
new file mode 100644
index 0000000..14c1c18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue208.adm
@@ -0,0 +1,6 @@
+{ "count": 1, "user": "RollandEckhard#500" }
+{ "count": 2, "user": "RollandEckhardstein#211" }
+{ "count": 1, "user": "RollandEckhardstein#221" }
+{ "count": 1, "user": "RollandEcstein#211" }
+{ "count": 1, "user": "Rolldstein#211" }
+{ "count": 1, "user": "Rolltein#211" }
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm
new file mode 100644
index 0000000..3d2819e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue29.adm
@@ -0,0 +1 @@
+{{ { "tweetid": "1023", "user": { "screen-name": "dflynn24", "lang": "en", "friends_count": 46, "statuses_count": 987, "name": "danielle flynn", "followers_count": 47 }, "sender-location": "40.904177,-72.958996", "send-time": "2010-02-21T11:56:02-05:00", "referred-topics": {{ "verizon" }}, "message-text": "i need a #verizon phone like nowwwww! :(" }, { "tweetid": "1024", "user": { "screen-name": "miriamorous", "lang": "en", "friends_count": 69, "statuses_count": 1068, "name": "Miriam Songco", "followers_count": 78 }, "send-time": "2010-02-21T11:11:43-08:00", "referred-topics": {{ "commercials", "verizon", "att" }}, "message-text": "#verizon & #att #commercials, so competitive" }, { "tweetid": "1025", "user": { "screen-name": "dj33", "lang": "en", "friends_count": 96, "statuses_count": 1696, "name": "Don Jango", "followers_count": 22 }, "send-time": "2010-02-21T12:38:44-05:00", "referred-topics": {{ "charlotte" }}, "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales" }, { "tweetid": "1026", "user": { "screen-name": "reallyleila", "lang": "en", "friends_count": 106, "statuses_count": 107, "name": "Leila Samii", "followers_count": 52 }, "send-time": "2010-02-21T21:31:57-06:00", "referred-topics": {{ "verizon", "at&t", "iphone" }}, "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!" } }}
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm
new file mode 100644
index 0000000..adf0f33
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55-1.adm
@@ -0,0 +1,49 @@
+[ 1.1f, 1.1f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.1f, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.1f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.1f, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.1f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1.0f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.0f, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.0f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.0f, 1, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.0f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.2f, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.2f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.2f, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.2f, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.2f, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.0f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 0.9d, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 0.9d, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 1, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 0.9d, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1.3d, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.2f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 1.3d, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1.3d, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1.3d, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1.1f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1.0f, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1, 1.2f, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 1, 1.3d, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 1, 1, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
+[ 1, 2, "=", false, "<", true, "<=", true, ">", false, ">=", false ]
+[ 2, 1.1f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.0f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.2f, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 0.9d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1.3d, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 1, "=", false, "<", false, "<=", false, ">", true, ">=", true ]
+[ 2, 2, "=", true, "<", false, "<=", true, ">", false, ">=", true ]
diff --git a/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm
new file mode 100644
index 0000000..d384bce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/open-closed/query-issue55.adm
@@ -0,0 +1,4 @@
+[ 1, 3 ]
+[ 4, 5, 2 ]
+[ -1, -3, 0 ]
+[ "a" ]
diff --git a/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm
new file mode 100644
index 0000000..190423f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-issue201.adm
@@ -0,0 +1,100 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index af49e84..384983d 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -739,6 +739,11 @@
</test-group>
<test-group name="dml">
<test-case FilePath="dml">
+ <compilation-unit name="query-issue205">
+ <output-file compare="Text">query-issue205.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="dml">
<compilation-unit name="delete-from-loaded-dataset-with-index">
<output-file compare="Text">delete-from-loaded-dataset-with-index.adm</output-file>
</compilation-unit>
@@ -2299,6 +2304,31 @@
<output-file compare="Text">open-closed-14.adm</output-file>
</compilation-unit>
</test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue134">
+ <output-file compare="Text">query-issue134.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue55">
+ <output-file compare="Text">query-issue55.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue55-1">
+ <output-file compare="Text">query-issue55-1.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue166">
+ <output-file compare="Text">query-issue166.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="open-closed">
+ <compilation-unit name="query-issue208">
+ <output-file compare="Text">query-issue208.adm</output-file>
+ </compilation-unit>
+ </test-case>
<!--
<test-case FilePath="open-closed">
<compilation-unit name="open-closed-15">
@@ -3557,6 +3587,11 @@
</test-group>
<test-group name="user-defined-functions">
<test-case FilePath="user-defined-functions">
+ <compilation-unit name="query-issue201">
+ <output-file compare="Text">query-issue201.adm</output-file>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="user-defined-functions">
<compilation-unit name="udf01">
<output-file compare="Text">udf01.adm</output-file>
</compilation-unit>