http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.3.query.aql
new file mode 100644
index 0000000..57a836c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/numeric-comparison_01/numeric-comparison_01.3.query.aql
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+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]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.3.query.aql
new file mode 100644
index 0000000..fb68d50
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string/string.3.query.aql
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := "AA"
+let $c2 := "B"
+let $r1 := $c1 > $c2
+let $r2 := $c1 >= $c2
+let $r3 := $c1 < $c2
+let $r4 := $c1 <= $c2
+let $r5 := $c1 = $c2
+let $r6 := $c1 != $c2
+return {"result1": $r1,"result2": $r2,"result3": $r3,"result4": $r4,"result5": 
$r5, "result6": $r6}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string_null/string_null.1.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string_null/string_null.1.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string_null/string_null.1.query.aql
new file mode 100644
index 0000000..3f81b87
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/string_null/string_null.1.query.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+let $c1 := "AA"
+let $c3 := null
+let $r1 := $c1 > $c3
+let $r2 := $c3 >= $c1
+let $r3 := $c1 < $c3
+let $r4 := $c3 <= $c1
+let $r5 := $c1 = $c3
+let $r6 := $c3 != $c1
+return {"result1": $r1,"result2": $r2,"result3": $r3,"result4": $r4,"result5": 
$r5, "result6": $r6}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.1.ddl.aql
new file mode 100644
index 0000000..15642ca
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.3.query.aql
new file mode 100644
index 0000000..0d97b17
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/time_order/time_order.3.query.aql
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $t1 := time("13:00:00.382-10:00")
+let $t2 := time("23:59:59.999Z")
+let $t3 := time("22:00:00+03:00")
+let $t4 := time("00:00:00.00Z")
+let $t5 := time("00:00:00.00-02:00")
+let $t6 := time("00:00:00.47+04:00")
+
+for $t in [$t1, $t2, $t3, $t4, $t5, $t6]
+order by $t
+return $t

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.1.ddl.aql
new file mode 100644
index 0000000..b8b7c80
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.1.ddl.aql
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse channels if exists;
+create dataverse channels;
+use dataverse channels;
+
+create type TypeA as closed
+{ "resultId":uuid, "subscriptionId":uuid, "deliveryTime":datetime }
+
+create dataset nearbyTweetChannelResults(TypeA)
+primary key resultId autogenerated;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.2.update.aql
new file mode 100644
index 0000000..0d435a0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.2.update.aql
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse channels;
+
+insert into dataset nearbyTweetChannelResults(
+{"subscriptionId":uuid("d0b6fac0-3903-43dc-8ef6-7b0923ffc759"), 
"deliveryTime":datetime("2011-08-25T10:10:00.000Z")}
+);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.3.query.aql
new file mode 100644
index 0000000..cd006ad
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/uuid_1/uuid_01.3.query.aql
@@ -0,0 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse channels;
+for $result in dataset nearbyTweetChannelResults
+where $result.subscriptionId=uuid("d0b6fac0-3903-43dc-8ef6-7b0923ffc759")
+return $result.subscriptionId;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.1.ddl.aql
new file mode 100644
index 0000000..adb915b
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.1.ddl.aql
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description      :   Check comparison and order-by for year-month-duration
+ * Expected Result  :   Success
+ * Date             :   May 18, 2013
+ */
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.2.update.aql
new file mode 100644
index 0000000..a8374b5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.2.update.aql
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description      :   Check comparison and order-by for year-month-duration
+ * Expected Result  :   Success
+ * Date             :   May 18, 2013
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.3.query.aql
new file mode 100644
index 0000000..60bd7f4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/year_month_duration_order/year_month_duration_order.3.query.aql
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description      :   Check comparison and order-by for year-month-duration
+ * Expected Result  :   Success
+ * Date             :   May 18, 2013
+ */
+use dataverse test;
+
+let $dr1 := year-month-duration("P439Y")
+let $dr2 := year-month-duration("-P328M")
+let $dr3 := year-month-duration("-P48Y12M")
+let $dr4 := year-month-duration("P12M")
+
+for $dr in [$dr1, $dr2, $dr3, $dr4]
+order by $dr
+return $dr

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.1.ddl.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.1.ddl.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.3.query.aql
new file mode 100644
index 0000000..70763d9
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/add-null/add-null.3.query.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description      :   Add anything plus null, the result should be null.
+ * Expected Result  :   Success
+ * Date             :   19th July 2012
+ */
+
+let $x := 1
+let $y := 10
+let $z := 20
+return ($x+$y+$z+null)

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.3.query.aql
new file mode 100644
index 0000000..c1c8f98
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/binary_01/binary_01.3.query.aql
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := hex("ABCDEF0123456789")
+let $c2 := hex("abcdef0123456789")
+let $c3 := hex("0A0B0C0D0E0F")
+let $c4 := hex('01020304050607080900')
+let $c5 := hex('')
+let $c6 := hex($c1)
+
+let $c7 := 
base64("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM+/")
+let $c8 := base64('')
+let $c9 := base64('QXN0ZXJpeA==')
+let $c10 := base64('QXN0ZXJpeAE=')
+let $c11 := base64('QXN0ZXJpeAE8')
+let $c12 := base64($c11)
+
+return [ $c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9,$c10,$c11,$c12 ]

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.3.query.aql
new file mode 100644
index 0000000..99ad694
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/boolean_01/boolean_01.3.query.aql
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := boolean("true")
+let $c2 := boolean("false")
+let $c3 := boolean($c2)
+
+return
+{
+    "boolean1": $c1,
+    "boolean2": $c2,
+    "boolean3": $c3
+}
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.1.ddl.aql
new file mode 100644
index 0000000..d17ea60
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.3.query.aql
new file mode 100644
index 0000000..392bdc7
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/circle_01/circle_01.3.query.aql
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := circle("10.1234,11.1e-1 +10.2E-2")
+let $c2 := circle("0.1234,-1.00e-10 +10.5E-2")
+let $c3 := circle($c2)
+
+return
+{
+    "circle1": $c1,
+    "circle2": $c2,
+    "circle3": $c3
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.2.update.aql
new file mode 100644
index 0000000..6c98c1e
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.2.update.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.3.query.aql
new file mode 100644
index 0000000..22f6f1a
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/date_01/date_01.3.query.aql
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := date("2010-10-30")
+let $c2 := date("1987-11-19")
+let $c3 := date("-1987-11-19")
+let $c4 := date("0001-12-27")
+let $c5 := date("-1951-12-27")
+let $c6 := date("-2043-11-19")
+let $c7 := date("-19280329")
+let $c8 := date("19280329")
+let $c9 := date("19000228")
+let $c10 := date("20000229")
+let $c11 := date($c10)
+
+return
+{
+    "date1": $c1,
+    "date2": $c2,
+    "date3": $c3,
+    "date4": $c4,
+    "date5": $c5,
+    "date6": $c6,
+    "date7": $c7,
+    "date8": $c8,
+    "date9": $c9,
+    "date10": $c10,
+    "date11": $c11
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.3.query.aql
new file mode 100644
index 0000000..448f8f0
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01/datetime_01.3.query.aql
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := datetime("2010-10-30T10:50:56.999+05:45")
+let $c2 := datetime("2010-10-30T10:30:56.250-10:00")
+let $c3 := datetime("1987-11-19T09:20:00.200Z")
+let $c4 := datetime("1987-11-19T10:50:56Z")
+let $c5 := datetime("-1987-11-19T10:50:56.099-05:30")
+let $c6 := datetime("-0001-11-19T10:50:56.719Z")
+let $c7 := datetime("1951-12-27T12:20:15Z")
+let $c8 := datetime("2043-11-19T10:50:56.719Z")
+let $c9 := datetime("-19280329T174937374-0630")
+let $c10 := datetime("-19280329T174937374+0630")
+let $c11 := datetime("-19280329T174937374")
+let $c12 := datetime("-19280329T174937374+0630")
+let $c13 := datetime("-19280329T17493737+0630")
+let $c14 := datetime("-19280301T05493737+0630")
+let $c15 := datetime($c14)
+
+return
+{
+    "datetime1": $c1,
+    "datetime2": $c2,
+    "datetime3": $c3,
+    "datetime4": $c4,
+    "datetime5": $c5,
+    "datetime6": $c6,
+    "datetime7": $c7,
+    "datetime8": $c8,
+    "datetime9": $c9,
+    "datetime10": $c10,
+    "datetime11": $c11,
+    "datetime12": $c12,
+    "datetime13": $c13,
+    "datetime14": $c14,
+    "datetime15": $c15
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.1.ddl.aql
new file mode 100644
index 0000000..cbc5458
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.1.ddl.aql
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.3.query.aql
new file mode 100644
index 0000000..db4473c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/double_01/double_01.3.query.aql
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+
+let $c1 := double("NaN")
+let $c2 := double("INF")
+let $c3 := double("-INF")
+let $c4 := double("-80.20d")
+let $c5 := double("-20.56e-30")
+let $c6 := double("-20.56e-300")
+let $c7 := double($c6)
+
+return
+{
+    "double1": $c1,
+    "double2": $c2,
+    "double3": $c3,
+    "double4": $c4,
+    "double5": $c5,
+    "double6": $c6,
+    "double7": $c7
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
new file mode 100644
index 0000000..6b658e7
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test duration constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
new file mode 100644
index 0000000..7eb07c8
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test duration constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
new file mode 100644
index 0000000..5ccc7b4
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test duration constructors
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */
+
+use dataverse test;
+
+let $c1 := duration("P30Y10M25DT13H12M50S")
+let $c2 := duration("P25DT13H12M50S")
+let $c3 := duration("PT13H12M50S")
+let $c4 := duration("P30YT12MS")
+let $c5 := duration("PT13H")
+let $c6 := duration("-P30Y10M25DT13H12M50S")
+let $c7 := duration("-P25DT13H12M50S")
+let $c8 := duration("-PT13H50S")
+let $c9 := duration("P120D")
+let $c10 := duration("-P28M")
+let $c11 := duration("PT29M90.937S")
+let $c12 := duration("P300Y15M60DT300H98M482.435S")
+let $c13 := duration($c12)
+
+return
+{
+    "duration1": $c1,
+    "duration2": $c2,
+    "duration3": $c3,
+    "duration4": $c4,
+    "duration5": $c5,
+    "duration6": $c6,
+    "duration7": $c7,
+    "duration8": $c8,
+    "duration9": $c9,
+    "duration10": $c10,
+    "duration11": $c11,
+    "duration12": $c12,
+    "duration13": $c13
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
new file mode 100644
index 0000000..8430bf5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test sub type duration (year-month-duration and 
day-time-duration) constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
new file mode 100644
index 0000000..47efe9c
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test sub type duration (year-month-duration and 
day-time-duration) constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * issue        : 363
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
new file mode 100644
index 0000000..d294392
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Description  : test sub type duration (year-month-duration and 
day-time-duration) constructors
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * issue        : 363
+ */
+
+use dataverse test;
+
+let $c1 := year-month-duration("P30Y10M")
+let $c2 := day-time-duration("P25DT13H12M50S")
+let $c3 := day-time-duration("PT13H12M50S")
+let $c4 := year-month-duration("P30Y")
+let $c5 := day-time-duration("PT13H")
+let $c6 := year-month-duration("-P30Y10M")
+let $c7 := day-time-duration("-P25DT13H12M50S")
+let $c8 := day-time-duration("-PT13H50S")
+let $c9 := day-time-duration("P120D")
+let $c10 := year-month-duration("-P28M")
+let $c11 := day-time-duration("PT29M90.937S")
+let $c12 := year-month-duration("P300Y15M")
+let $c13 := year-month-duration($c12)
+
+return
+{
+    "duration1": $c1,
+    "duration2": $c2,
+    "duration3": $c3,
+    "duration4": $c4,
+    "duration5": $c5,
+    "duration6": $c6,
+    "duration7": $c7,
+    "duration8": $c8,
+    "duration9": $c9,
+    "duration10": $c10,
+    "duration11": $c11,
+    "duration12": $c12,
+    "duration13": $c13
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.1.ddl.aql
new file mode 100644
index 0000000..d17ea60
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.3.query.aql
new file mode 100644
index 0000000..ad92a44
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/float_01/float_01.3.query.aql
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := float("NaN")
+let $c2 := float("INF")
+let $c3 := float("-INF")
+let $c4 := float("-80.20")
+let $c5 := float("-20.56e-30")
+let $c6 := float($c5)
+// +5.0E10 would not generate a precise calc. even with parseFloat
+
+return
+{
+    "float1": $c1,
+    "float2": $c2,
+    "float3": $c3,
+    "float4": $c4,
+    "float5": $c5,
+    "float6": $c6
+}
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.1.ddl.aql
new file mode 100644
index 0000000..d17ea60
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.3.query.aql
new file mode 100644
index 0000000..05dd24f
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/int_01/int_01.3.query.aql
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+use dataverse test;
+
+let $c1 := int8("+80i8")
+let $c2 := int16("160")
+let $c3 := int32("+320i32")
+let $c4 := int64("640")
+
+let $c5 := int8("-80")
+let $c6 := int16("-160i16")
+let $c7 := int32("-320")
+let $c8 := int64("-640i64")
+
+let $c9 := int64("-9223372036854775808")
+
+let $c10 := int8($c1)
+let $c11 := int16($c2)
+let $c12 := int32($c3)
+let $c13 := int64($c4)
+
+return
+{
+    "int8": $c1,
+    "int16": $c2,
+    "int32": $c3,
+    "int64": $c4,
+
+    "int8_2": $c5,
+    "int16_2": $c6,
+    "int32_2": $c7,
+    "int64_2": $c8,
+
+    "int64_min" : $c9,
+
+    "int8_3": $c10,
+    "int16_3": $c11,
+    "int32_3": $c12,
+    "int64_3": $c13
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.1.ddl.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.1.ddl.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.1.ddl.aql
new file mode 100644
index 0000000..d17ea60
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.1.ddl.aql
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+drop dataverse test if exists;
+create dataverse test;
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.2.update.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.2.update.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.2.update.aql
new file mode 100644
index 0000000..042f3ce
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.2.update.aql
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/c4dbb614/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.3.query.aql
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.3.query.aql
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.3.query.aql
new file mode 100644
index 0000000..b5eb998
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/constructor/interval/interval.3.query.aql
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use dataverse test;
+
+let $itv41 := interval-start-from-date(date("0001-12-27"), 
duration("P3Y394DT48H398.483S"))
+let $itv42 := interval-start-from-date("0001-12-27", 
duration("P3Y394DT48H398.483S"))
+let $itv43 := interval-start-from-date(date("0001-12-27"), 
"P3Y394DT48H398.483S")
+let $itv44 := interval-start-from-date("0001-12-27", "P3Y394DT48H398.483S")
+let $itv45 := interval-start-from-date(null, duration("P3Y394DT48H398.483S"))
+let $itv46 := interval-start-from-date(date("0001-12-27"), null)
+let $itv51 := interval-start-from-time(time("20:03:20.948"), 
duration("P60DT48M389.938S"))
+let $itv52 := interval-start-from-time("20:03:20.948", 
duration("P60DT48M389.938S"))
+let $itv53 := interval-start-from-time(time("20:03:20.948"), 
"P60DT48M389.938S")
+let $itv54 := interval-start-from-time("20:03:20.948", "P60DT48M389.938S")
+let $itv55 := interval-start-from-time(null, duration("P60DT48M389.938S"))
+let $itv56 := interval-start-from-time(time("20:03:20.948"), null)
+let $itv61 := 
interval-start-from-datetime(datetime("-2043-11-19T15:32:39.293"), 
duration("P439Y3M20DT20H39M58.949S"))
+let $itv62 := interval-start-from-datetime("-2043-11-19T15:32:39.293", 
duration("P439Y3M20DT20H39M58.949S"))
+let $itv63 := 
interval-start-from-datetime(datetime("-2043-11-19T15:32:39.293"), 
"P439Y3M20DT20H39M58.949S")
+let $itv64 := interval-start-from-datetime("-2043-11-19T15:32:39.293", 
"P439Y3M20DT20H39M58.949S")
+let $itv65 := interval-start-from-datetime(null, 
duration("P439Y3M20DT20H39M58.949S"))
+let $itv66 := 
interval-start-from-datetime(datetime("-2043-11-19T15:32:39.293"), null)
+let $itv71 := interval(date("2010-10-30"), date("2012-10-21"))
+let $itv72 := interval(null, date("2012-10-21"))
+let $itv73 := interval(date("2010-10-30"), null)
+let $itv74 := interval(time("03:04:05.678-11:00"), time("232425267+0200"))
+let $itv75 := interval(null, time("232425267+0200"))
+let $itv76 := interval(time("03:04:05.678-11:00"), null)
+let $itv77 := interval(datetime("-1987-11-19T02:43:57.938+08:00"), 
datetime("19991112T124935948-0700"))
+let $itv78 := interval(null, datetime("19991112T124935948-0700"))
+let $itv79 := interval(datetime("-1987-11-19T02:43:57.938+08:00"), null)
+
+return {"interval41": $itv41, "interval42": $itv42, "interval43": $itv43, 
"interval44": $itv44, "interval45": $itv45, "interval46": $itv46, "interval51": 
$itv51, "interval52": $itv52, "interval53": $itv53, "interval54": $itv54, 
"interval55": $itv55, "interval56": $itv56, "interval61": $itv61, "interval62": 
$itv62, "interval63": $itv63, "interval64": $itv64, "interval65": $itv65, 
"interval66": $itv66, "interval71": $itv71, "interval72": $itv72, "interval73": 
$itv73, "interval74": $itv74, "interval75": $itv75, "interval76": $itv76, 
"interval77": $itv77, "interval78": $itv78, "interval79": $itv79}
+

Reply via email to