Merge branch 'master' into jarodwen/hotfix/issue363: 1f82dcc
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
index 3dad464..dc86722 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/SetClosedRecordConstructorsRule.java
@@ -186,6 +186,8 @@
                 case DATE:
                 case TIME:
                 case DURATION:
+                case YEARMONTHDURATION:
+                case DAYTIMEDURATION:
                 case INTERVAL:
                 case POINT:
                 case POINT3D:
diff --git a/asterix-app/.gitignore b/asterix-app/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/asterix-app/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql
new file mode 100644
index 0000000..c04af59
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description  : create a dataset using year-month-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as open {
+id:year-month-duration,
+name:string
+}
+
+create dataset Employee(Emp) primary key id;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql
new file mode 100644
index 0000000..d07ed34
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.2.update.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using year-month-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+insert into dataset Employee({"id":year-month-duration("P16Y"), "name": "John"})
+insert into dataset Employee({"id":year-month-duration("-P37M"), "name": "Alex"})
+insert into dataset Employee({"id":year-month-duration("P2013Y"), "name": "Bob"})
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
new file mode 100644
index 0000000..a25bfb8
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_0/issue_363_temporal_key_0.3.query.aql
@@ -0,0 +1,13 @@
+/*
+ * Description  : create a dataset using year-month-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+for $x in dataset('Employee')
+where $x.id > year-month-duration("P350M")
+return $x
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql
new file mode 100644
index 0000000..1f59a51
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description  : create a dataset using datetime as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as open {
+id:datetime,
+name:string
+}
+
+create dataset Employee(Emp) primary key id;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql
new file mode 100644
index 0000000..0640b52
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.2.update.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using datetime as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+insert into dataset Employee({"id":datetime("1900-01-01T00:00:00"), "name": "John"})
+insert into dataset Employee({"id":datetime("2000-01-01T00:00:00"), "name": "Alex"})
+insert into dataset Employee({"id":datetime("2013-01-01T00:00:00"), "name": "Bob"})
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
new file mode 100644
index 0000000..2b82717
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_1/issue_363_temporal_key_1.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using datetime as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+for $x in dataset('Employee')
+where $x.id > datetime("2007-07-07T07:07:07.777Z")
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql
new file mode 100644
index 0000000..97c62cf
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description  : create a dataset using time as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as open {
+id:time,
+name:string
+}
+
+create dataset Employee(Emp) primary key id;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql
new file mode 100644
index 0000000..f98a754
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.2.update.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using time as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+insert into dataset Employee({"id":time("03:10:00.493Z"), "name": "John"})
+insert into dataset Employee({"id":time("20:37:19+08:00"), "name": "Alex"})
+insert into dataset Employee({"id":time("21:39:17.948-04:00"), "name": "Bob"})
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
new file mode 100644
index 0000000..197b461
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_2/issue_363_temporal_key_2.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using time as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+for $x in dataset('Employee')
+where $x.id > time("07:07:07.777Z")
+return $x
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
new file mode 100644
index 0000000..5e4ae49
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description  : create a dataset using date as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as open {
+id:date,
+name:string
+}
+
+create dataset Employee(Emp) primary key id;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql
new file mode 100644
index 0000000..624cdc8
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.2.update.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using date as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+insert into dataset Employee({"id":date("2010-01-01"), "name": "John"})
+insert into dataset Employee({"id":date("-1912-10-11"), "name": "Alex"})
+insert into dataset Employee({"id":date("0732-02-02"), "name": "Bob"})
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql
new file mode 100644
index 0000000..3f9960e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_3/issue_363_temporal_key_3.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using date as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+for $x in dataset('Employee')
+where $x.id > date("2007-07-07")
+return $x
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
new file mode 100644
index 0000000..9a3da89
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.1.ddl.aql
@@ -0,0 +1,17 @@
+/*
+ * Description  : create a dataset using day-time-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type Emp as open {
+id:day-time-duration,
+name:string
+}
+
+create dataset Employee(Emp) primary key id;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql
new file mode 100644
index 0000000..04a35de
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.2.update.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using day-time-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+
+use dataverse test;
+
+insert into dataset Employee({"id":day-time-duration("P380DT983M"), "name": "John"})
+insert into dataset Employee({"id":day-time-duration("-P3829H849.392S"), "name": "Alex"})
+insert into dataset Employee({"id":day-time-duration("PT93847M0.392S"), "name": "Bob"})
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql
new file mode 100644
index 0000000..e45250b
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/issue_363_temporal_key_4/issue_363_temporal_key_4.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : create a dataset using day-time-duration as the primary key 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * Issue        : 363
+ */
+ 
+use dataverse test;
+
+for $x in dataset('Employee')
+where $x.id > day-time-duration("P350D")
+return $x
diff --git a/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_0/issue363_temporal_key_0.1.adm b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_0/issue363_temporal_key_0.1.adm
new file mode 100644
index 0000000..be11d3c
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_0/issue363_temporal_key_0.1.adm
@@ -0,0 +1 @@
+{ "id": year-month-duration("P2013Y"), "name": "Bob" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_1/issue363_temporal_key_1.1.adm b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_1/issue363_temporal_key_1.1.adm
new file mode 100644
index 0000000..f4a131a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_1/issue363_temporal_key_1.1.adm
@@ -0,0 +1 @@
+{ "id": datetime("2013-01-01T00:00:00.000Z"), "name": "Bob" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_2/issue363_temporal_key_2.1.adm b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_2/issue363_temporal_key_2.1.adm
new file mode 100644
index 0000000..e9829f4
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_2/issue363_temporal_key_2.1.adm
@@ -0,0 +1,2 @@
+{ "id": time("12:37:19.000Z"), "name": "Alex" }
+{ "id": time("01:39:17.948Z"), "name": "Bob" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_3/issue363_temporal_key_3.1.adm b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_3/issue363_temporal_key_3.1.adm
new file mode 100644
index 0000000..125c38a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_3/issue363_temporal_key_3.1.adm
@@ -0,0 +1 @@
+{ "id": date("2010-01-01"), "name": "John" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_4/issue363_temporal_key_4.1.adm b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_4/issue363_temporal_key_4.1.adm
new file mode 100644
index 0000000..43bda78
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/issue_363_temporal_key_4/issue363_temporal_key_4.1.adm
@@ -0,0 +1 @@
+{ "id": day-time-duration("P380DT16H23M"), "name": "John" }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta17/meta17.1.adm b/asterix-app/src/test/resources/metadata/results/basic/meta17/meta17.1.adm
index 2de89a6..d193dd1 100644
--- a/asterix-app/src/test/resources/metadata/results/basic/meta17/meta17.1.adm
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta17/meta17.1.adm
@@ -42,6 +42,7 @@
 { "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
+{ "DataverseName": "Metadata", "DatatypeName": "day-time-duration", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
@@ -58,3 +59,4 @@
 { "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
+{ "DataverseName": "Metadata", "DatatypeName": "year-month-duration", "Derived": null, "Timestamp": "Fri Feb 08 15:49:29 PST 2013" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype/metadata_datatype.1.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype/metadata_datatype.1.adm
index 84e2ca8..cecdb85 100644
--- a/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype/metadata_datatype.1.adm
+++ b/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype/metadata_datatype.1.adm
@@ -42,6 +42,7 @@
 { "DataverseName": "Metadata", "DatatypeName": "circle", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "date", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "datetime", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
+{ "DataverseName": "Metadata", "DatatypeName": "day-time-duration", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "double", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "duration", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "float", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
@@ -58,3 +59,4 @@
 { "DataverseName": "Metadata", "DatatypeName": "rectangle", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "string", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
 { "DataverseName": "Metadata", "DatatypeName": "time", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
+{ "DataverseName": "Metadata", "DatatypeName": "year-month-duration", "Derived": null, "Timestamp": "Fri Mar 29 11:19:47 PDT 2013" }
diff --git a/asterix-app/src/test/resources/metadata/testsuite.xml b/asterix-app/src/test/resources/metadata/testsuite.xml
index 47bcafa..63487d4 100644
--- a/asterix-app/src/test/resources/metadata/testsuite.xml
+++ b/asterix-app/src/test/resources/metadata/testsuite.xml
@@ -150,6 +150,31 @@
         <output-dir compare="Text">issue_251_dataset_hint_4</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="issue_363_temporal_key_0">
+        <output-dir compare="Text">issue_363_temporal_key_0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="issue_363_temporal_key_1">
+        <output-dir compare="Text">issue_363_temporal_key_1</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="issue_363_temporal_key_2">
+        <output-dir compare="Text">issue_363_temporal_key_2</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="issue_363_temporal_key_3">
+        <output-dir compare="Text">issue_363_temporal_key_3</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="issue_363_temporal_key_4">
+        <output-dir compare="Text">issue_363_temporal_key_4</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="exception">
     <test-case FilePath="exception">
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.1.ddl.aql
new file mode 100644
index 0000000..ba511f2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for equality comparisons for non-total-ordered types
+ * Expected Res : Success
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.2.update.aql
new file mode 100644
index 0000000..dd5635c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for equality comparisons for non-total-ordered types
+ * Expected Res : Success
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.3.query.aql
new file mode 100644
index 0000000..7e898a2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_equality/issue363_equality.3.query.aql
@@ -0,0 +1,54 @@
+/*
+ * Description  : a test case for equality comparisons for non-total-ordered types
+ * Expected Res : Success
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+
+let $v1 := duration("P3Y6M3DT9H5M2.348S")
+let $v2 := year-month-duration("P3Y6M")
+let $v3 := day-time-duration("P3DT9H5M2.348S")
+let $v4 := point("47.44,80.65")
+let $v5 := line("10.1234,11.1e-1 +10.2E-2,-11.22")
+let $v6 := polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+let $v7 := circle("0.1234,-1.00e-10 +10.5E-2")
+let $v8 := rectangle("0.1234,-1.00e-10 5.5487,0.48765")
+let $v9 := interval-from-datetime(datetime("-1987-11-19T02:43:57.938+08:00"), datetime("19991112T124935948-0700"))
+let $dv1 := duration("P3Y6M3DT9H5M2.348S")
+let $dv2 := year-month-duration("P3Y6M")
+let $dv3 := day-time-duration("P3DT9H5M2.348S")
+let $dv4 := point("47.44,80.65")
+let $dv5 := line("10.1234,11.1e-1 +10.2E-2,-11.22")
+let $dv6 := polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+let $dv7 := circle("0.1234,-1.00e-10 +10.5E-2")
+let $dv8 := rectangle("0.1234,-1.00e-10 5.5487,0.48765")
+let $dv9 := interval-from-datetime(datetime("-1987-11-19T02:43:57.938+08:00"), datetime("19991112T124935948-0700"))
+let $ndv1 := duration("P4Y6M3DT9H5M2.348S")
+let $ndv2 := year-month-duration("P3Y7M")
+let $ndv3 := day-time-duration("P3DT1H5M2.348S")
+let $ndv4 := point("47.4444,80.65")
+let $ndv5 := line("10.5678,11.1e-1 +10.2E-2,-11.22")
+let $ndv6 := polygon("-1.0,+10.5e2 -02.19E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+let $ndv7 := circle("0.5678,-1.00e-10 +10.5E-2")
+let $ndv8 := rectangle("0.5678,-1.00e-10 5.5487,0.48765")
+let $ndv9 := interval-from-datetime(datetime("-1983-11-19T02:43:57.938+08:00"), datetime("19991112T124935948-0700"))
+
+return { "duration":  $v1 = $dv1, 
+"year-month-duration":  $v2 = $dv2, 
+"day-time-duration":  $v3 = $dv3, 
+"point": $v4 = $dv4, 
+"line": $v5 = $dv5, 
+"polygon": $v6 = $dv6,
+"circle": $v7 = $dv7,
+"rectangle": $v8 = $dv8,
+"interval": $v9 = $dv9,
+"duration2":  $v1 != $ndv1, 
+"year-month-duration2": $v2 != $ndv2, 
+"day-time-duration2":  $v3 != $ndv3, 
+"point2": $v4 != $ndv4, 
+"line2": $v5 != $ndv5, 
+"polygon2": $v6 != $ndv6,
+"circle2": $v7 != $ndv7,
+"rectangle2": $v8 != $ndv8,
+"interval2": $v9 != $ndv9
+}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.1.ddl.aql
new file mode 100644
index 0000000..b05c7fc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of circle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.2.update.aql
new file mode 100644
index 0000000..b05c7fc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of circle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.3.query.aql
new file mode 100644
index 0000000..2c65355
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_circle/issue363_inequality_circle.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of circle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := circle("0.1234,-1.00e-10 +10.5E-2")
+let $dv1 := circle("0.5678,-1.00e-10 +10.5E-2")
+
+return { "circle0":  $v1 > $dv1, "circle1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.1.ddl.aql
new file mode 100644
index 0000000..6533b0d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of duration
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.2.update.aql
new file mode 100644
index 0000000..6533b0d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of duration
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.3.query.aql
new file mode 100644
index 0000000..31d8b7b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_duration/issue363_inequality_duration.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of duration
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := duration("P300Y6M3DT9H5M2.348S")
+let $dv1 := duration("P3Y6M3DT9H5M2.348S")
+
+return { "duration0":  $v1 > $dv1, "duration1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.1.ddl.aql
new file mode 100644
index 0000000..ac47f3f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of interval
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.2.update.aql
new file mode 100644
index 0000000..ac47f3f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of interval
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.3.query.aql
new file mode 100644
index 0000000..b5c22e0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_interval/issue363_inequality_interval.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of interval
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := interval-from-datetime(datetime("-1987-11-19T02:43:57.938+08:00"), datetime("19991112T124935948-0700"))
+let $dv1 := interval-from-datetime(datetime("-1983-11-19T02:43:57.938+08:00"), datetime("19991112T124935948-0700"))
+
+return { "interval0":  $v1 > $dv1, "interval1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.1.ddl.aql
new file mode 100644
index 0000000..3618d18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of line
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.2.update.aql
new file mode 100644
index 0000000..3618d18
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of line
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.3.query.aql
new file mode 100644
index 0000000..a311f90
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_line/issue363_inequality_line.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of line
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := line("10.1234,11.1e-1 +10.2E-2,-11.22")
+let $dv1 := line("10.1234,11.1e-1 +10.2E-2,-11.22")
+
+return { "line0":  $v1 > $dv1, "line1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.1.ddl.aql
new file mode 100644
index 0000000..434dd0a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of point
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.2.update.aql
new file mode 100644
index 0000000..434dd0a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of point
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.3.query.aql
new file mode 100644
index 0000000..66a5c9e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_point/issue363_inequality_point.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of point
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := point("47.44,80.65")
+let $dv1 := point("47.4444,80.65")
+
+return { "point0":  $v1 > $dv1, "point1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.ddl.aql
new file mode 100644
index 0000000..12e3ca6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of polygon
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.2.update.aql
new file mode 100644
index 0000000..12e3ca6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of polygon
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.3.query.aql
new file mode 100644
index 0000000..569b518
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_polygon/issue363_inequality_polygon.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of polygon
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+let $dv1 := polygon("-1.0,+10.5e2 -02.19E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75")
+
+return { "polygon0":  $v1 > $dv1, "polygon1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.ddl.aql
new file mode 100644
index 0000000..c62c7a3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.ddl.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of rectangle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.2.update.aql
new file mode 100644
index 0000000..c62c7a3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : a test case for inequality comparisons of rectangle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.3.query.aql
new file mode 100644
index 0000000..8d44f20
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.3.query.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : a test case for inequality comparisons of rectangle
+ * Expected Res : Failure
+ * Date         : 9 May 2013
+ * Issue        : 363
+ */
+ 
+let $v1 := rectangle("0.1234,-1.00e-10 5.5487,0.48765")
+let $dv1 := rectangle("0.5678,-1.00e-10 5.5487,0.48765")
+
+return { "rectangle0":  $v1 > $dv1, "rectangle1": $dv1 < $v1 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
index 754ea81..84fe314 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.1.ddl.aql
@@ -1,3 +1,9 @@
+/*
+ * Description  : test duration constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */
+
 drop dataverse test if exists;
 create dataverse test;
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
index e69de29..0c32771 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.2.update.aql
@@ -0,0 +1,5 @@
+/*
+ * Description  : test duration constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
index 6db5228..898ab18 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01/duration_01.3.query.aql
@@ -1,3 +1,9 @@
+/*
+ * Description  : test duration constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ */
+
 use dataverse test;
 
 let $c1 := duration("P30Y10M25DT13H12M50S")
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
new file mode 100644
index 0000000..f3978bf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.1.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * 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;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
new file mode 100644
index 0000000..73d2817
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.2.update.aql
@@ -0,0 +1,6 @@
+/*
+ * Description  : test sub type duration (year-month-duration and day-time-duration) constructors 
+ * Expected Res : Success
+ * Date         : 7 May 2013
+ * issue        : 363
+ */
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
new file mode 100644
index 0000000..f526bc4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_02/duration_02.3.query.aql
@@ -0,0 +1,22 @@
+/*
+ * 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")
+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}
diff --git a/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
index 77fcc4f..c6fe3df 100644
--- a/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/temporal/duration_comps/duration_comps.3.query.aql
@@ -5,7 +5,7 @@
 let $dr3 := duration("P1Y")
 let $dr4 := duration("P13M")
 let $dr5 := duration("PT24H")
-let $dr6 := duration-from-months(months-of-year-month-duration($dr3))
-let $dr7 := duration-from-ms(ms-of-day-time-duration($dr1))
+let $dr6 := duration-from-months(months-from-year-month-duration(get-year-month-duration($dr3)))
+let $dr7 := duration-from-ms(ms-from-day-time-duration(get-day-time-duration($dr1)))
 
 return { "yearMonthGreaterComp" : year-month-duration-greater-than($dr4, $dr3), "dayTimeGreaterComp" : day-time-duration-greater-than($dr2, $dr1), "yearMonthLessComp" : year-month-duration-less-than($dr4, $dr3), "dayTimeLessComp" : day-time-duration-less-than($dr2, $dr1), "equal1": duration-equal($dr2, $dr5), "equal2": duration-equal($dr1, $dr5), "equal3": duration-equal($dr6, $dr3), "equal4": duration-equal($dr7, $dr1) }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_equality/issue363_equality.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_equality/issue363_equality.1.adm
new file mode 100644
index 0000000..ac3caa3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_equality/issue363_equality.1.adm
@@ -0,0 +1 @@
+{ "duration": true, "year-month-duration": true, "day-time-duration": true, "point": true, "line": true, "polygon": true, "circle": true, "rectangle": true, "interval": true, "duration2": true, "year-month-duration2": true, "day-time-duration2": true, "point2": true, "line2": true, "polygon2": true, "circle2": true, "rectangle2": true, "interval2": true }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_circle/issue363_inequality_circle.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_circle/issue363_inequality_circle.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_circle/issue363_inequality_circle.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_duration/issue363_inequality_duration.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_duration/issue363_inequality_duration.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_duration/issue363_inequality_duration.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_interval/issue363_inequality_interval.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_interval/issue363_inequality_interval.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_interval/issue363_inequality_interval.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_line/issue363_inequality_line.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_line/issue363_inequality_line.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_line/issue363_inequality_line.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_point/issue363_inequality_point.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_point/issue363_inequality_point.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_point/issue363_inequality_point.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_polygon/issue363_inequality_polygon.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.adm b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.adm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/issue363_inequality_rectangle/issue363_inequality_rectangle.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/duration_02/duration_02.1.adm b/asterix-app/src/test/resources/runtimets/results/constructor/duration_02/duration_02.1.adm
new file mode 100644
index 0000000..108af42
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/duration_02/duration_02.1.adm
@@ -0,0 +1 @@
+{ "duration1": year-month-duration("P30Y10M"), "duration2": day-time-duration("P25DT13H12M50S"), "duration3": day-time-duration("PT13H12M50S"), "duration4": year-month-duration("P30Y"), "duration5": day-time-duration("PT13H"), "duration6": year-month-duration("-P30Y10M"), "duration7": day-time-duration("-P25DT13H12M50S"), "duration8": day-time-duration("-PT13H50S"), "duration9": day-time-duration("P120D"), "duration10": year-month-duration("-P2Y4M"), "duration11": day-time-duration("PT30M30.937S"), "duration12": year-month-duration("P301Y3M") }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 5842563..4a61971 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -517,6 +517,53 @@
         <output-dir compare="Text">string_null</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_equality">
+        <output-dir compare="Text">issue363_equality</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_duration">
+        <output-dir compare="Text">issue363_inequality_duration</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_interval">
+        <output-dir compare="Text">issue363_inequality_interval</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_point">
+        <output-dir compare="Text">issue363_inequality_point</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_line">
+        <output-dir compare="Text">issue363_inequality_line</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_polygon">
+        <output-dir compare="Text">issue363_inequality_polygon</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_rectangle">
+        <output-dir compare="Text">issue363_inequality_rectangle</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="comparison">
+      <compilation-unit name="issue363_inequality_circle">
+        <output-dir compare="Text">issue363_inequality_circle</output-dir>
+        <expected-error>edu.uci.ics.asterix.common.exceptions.AsterixException</expected-error>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-group name="constructor">
     <test-case FilePath="constructor">
@@ -555,6 +602,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="constructor">
+      <compilation-unit name="duration_02">
+        <output-dir compare="Text">duration_02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="constructor">
       <compilation-unit name="float_01">
         <output-dir compare="Text">float_01</output-dir>
       </compilation-unit>
diff --git a/asterix-common/.gitignore b/asterix-common/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/asterix-common/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinTypeMap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinTypeMap.java
index 27cf542..aa8f452 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinTypeMap.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/AsterixBuiltinTypeMap.java
@@ -40,6 +40,8 @@
         _builtinTypeMap.put("time", BuiltinType.ATIME);
         _builtinTypeMap.put("datetime", BuiltinType.ADATETIME);
         _builtinTypeMap.put("duration", BuiltinType.ADURATION);
+        _builtinTypeMap.put("year-month-duration", BuiltinType.AYEARMONTHDURATION);
+        _builtinTypeMap.put("day-time-duration", BuiltinType.ADAYTIMEDURATION);
         _builtinTypeMap.put("interval", BuiltinType.AINTERVAL);
         _builtinTypeMap.put("point", BuiltinType.APOINT);
         _builtinTypeMap.put("point3d", BuiltinType.APOINT3D);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ACirclePartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ACirclePartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..06a6e53
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ACirclePartialBinaryComparatorFactory.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class ACirclePartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final ACirclePartialBinaryComparatorFactory INSTANCE = new ACirclePartialBinaryComparatorFactory();
+
+    private ACirclePartialBinaryComparatorFactory() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                // center.x
+                int c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1),
+                        ADoubleSerializerDeserializer.getDouble(b2, s2));
+                if (c == 0) {
+                    // center.y
+                    c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 8),
+                            ADoubleSerializerDeserializer.getDouble(b2, s2 + 8));
+                    if (c == 0) {
+                        // radius
+                        return Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 16),
+                                ADoubleSerializerDeserializer.getDouble(b2, s2 + 16));
+                    }
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADurationPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADurationPartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..39fc655
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADurationPartialBinaryComparatorFactory.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class ADurationPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final ADurationPartialBinaryComparatorFactory INSTANCE = new ADurationPartialBinaryComparatorFactory();
+
+    private ADurationPartialBinaryComparatorFactory() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                int c = Integer.compare(AInt32SerializerDeserializer.getInt(b1, s1),
+                        AInt32SerializerDeserializer.getInt(b2, s2));
+                if (c == 0) {
+                    return Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 4),
+                            ADoubleSerializerDeserializer.getDouble(b2, s2 + 4));
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..a20a860
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AIntervalPartialBinaryComparatorFactory.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class AIntervalPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final AIntervalPartialBinaryComparatorFactory INSTANCE = new AIntervalPartialBinaryComparatorFactory();
+
+    private AIntervalPartialBinaryComparatorFactory() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                int c = Double.compare(AInt64SerializerDeserializer.getLong(b1, s1),
+                        AInt64SerializerDeserializer.getLong(b2, s2));
+                if (c == 0) {
+                    c = Double.compare(AInt64SerializerDeserializer.getLong(b1, s1 + 8),
+                            AInt64SerializerDeserializer.getLong(b2, s2 + 8));
+                    if (c == 0) {
+                        c = Byte.compare(b1[s1 + 16], b2[s2 + 16]);
+                    }
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ALinePartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ALinePartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..e604c6a
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ALinePartialBinaryComparatorFactory.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class ALinePartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+    
+    public static final ALinePartialBinaryComparatorFactory INSTANCE = new ALinePartialBinaryComparatorFactory();
+    
+    private ALinePartialBinaryComparatorFactory(){
+        
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+            
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                int c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1),
+                        ADoubleSerializerDeserializer.getDouble(b2, s2));
+                if (c == 0) {
+                    c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 8),
+                            ADoubleSerializerDeserializer.getDouble(b2, s2 + 8));
+                    if (c == 0) {
+                        c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 16),
+                                ADoubleSerializerDeserializer.getDouble(b2, s2 + 16));
+                        if(c == 0){
+                            return Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 24),
+                                    ADoubleSerializerDeserializer.getDouble(b2, s2 + 24));
+                        }
+                    }
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
index 0e486e7..87acbc0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/AObjectAscBinaryComparatorFactory.java
@@ -35,9 +35,18 @@
                     .createBinaryComparator();
             final IBinaryComparator ascRectangleComp = RectangleBinaryComparatorFactory.INSTANCE
                     .createBinaryComparator();
-            final IBinaryComparator ascDateTimeComp = ADateTimeAscBinaryComparatorFactory.INSTANCE
+            final IBinaryComparator ascCircleComp = ACirclePartialBinaryComparatorFactory.INSTANCE
                     .createBinaryComparator();
-            final IBinaryComparator ascDateOrTimeComp = ADateOrTimeAscBinaryComparatorFactory.INSTANCE
+            final IBinaryComparator ascDurationComp = ADurationPartialBinaryComparatorFactory.INSTANCE
+                    .createBinaryComparator();
+            final IBinaryComparator ascIntervalComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+                    .createBinaryComparator();
+            final IBinaryComparator ascLineComp = ALinePartialBinaryComparatorFactory.INSTANCE.createBinaryComparator();
+            final IBinaryComparator ascPointComp = APointPartialBinaryComparatorFactory.INSTANCE
+                    .createBinaryComparator();
+            final IBinaryComparator ascPoint3DComp = APoint3DPartialBinaryComparatorFactory.INSTANCE
+                    .createBinaryComparator();
+            final IBinaryComparator ascPolygonComp = APolygonPartialBinaryComparatorFactory.INSTANCE
                     .createBinaryComparator();
 
             @Override
@@ -58,9 +67,14 @@
                     case BOOLEAN: {
                         return ascBoolComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
+                    case TIME:
+                    case DATE:
+                    case YEARMONTHDURATION:
                     case INT32: {
                         return ascIntComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
+                    case DATETIME:
+                    case DAYTIMEDURATION:
                     case INT64: {
                         return ascLongComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
@@ -76,12 +90,26 @@
                     case RECTANGLE: {
                         return ascRectangleComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
-                    case DATETIME: {
-                        return ascDateTimeComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    case CIRCLE: {
+                        return ascCircleComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
-                    case TIME:
-                    case DATE: {
-                        return ascDateOrTimeComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    case POINT: {
+                        return ascPointComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    }
+                    case POINT3D: {
+                        return ascPoint3DComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    }
+                    case LINE: {
+                        return ascLineComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    }
+                    case POLYGON: {
+                        return ascPolygonComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    }
+                    case DURATION: {
+                        return ascDurationComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
+                    }
+                    case INTERVAL: {
+                        return ascIntervalComp.compare(b1, s1 + 1, l1 - 1, b2, s2 + 1, l2 - 1);
                     }
                     default: {
                         throw new NotImplementedException("Comparison for type " + tag + " is not implemented");
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APoint3DPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APoint3DPartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..32c335b
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APoint3DPartialBinaryComparatorFactory.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class APoint3DPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final APoint3DPartialBinaryComparatorFactory INSTANCE = new APoint3DPartialBinaryComparatorFactory();
+
+    private APoint3DPartialBinaryComparatorFactory() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                int c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1),
+                        ADoubleSerializerDeserializer.getDouble(b2, s2));
+                if (c == 0) {
+                    c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 8),
+                            ADoubleSerializerDeserializer.getDouble(b2, s2 + 8));
+                    if (c == 0) {
+                        return Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 16),
+                                ADoubleSerializerDeserializer.getDouble(b2, s2 + 16));
+                    }
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APointPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APointPartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..3de6df8
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APointPartialBinaryComparatorFactory.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+
+public class APointPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public final static APointPartialBinaryComparatorFactory INSTANCE = new APointPartialBinaryComparatorFactory();
+
+    private APointPartialBinaryComparatorFactory() {
+
+    }
+
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                int c = Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1),
+                        ADoubleSerializerDeserializer.getDouble(b2, s2));
+                if (c == 0) {
+                    return Double.compare(ADoubleSerializerDeserializer.getDouble(b1, s1 + 8),
+                            ADoubleSerializerDeserializer.getDouble(b2, s2 + 8));
+                }
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APolygonPartialBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APolygonPartialBinaryComparatorFactory.java
new file mode 100644
index 0000000..187a478
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/APolygonPartialBinaryComparatorFactory.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
+import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import edu.uci.ics.hyracks.dataflow.common.data.marshalling.DoubleSerializerDeserializer;
+
+public class APolygonPartialBinaryComparatorFactory implements IBinaryComparatorFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public final static APolygonPartialBinaryComparatorFactory INSTANCE = new APolygonPartialBinaryComparatorFactory();
+
+    private APolygonPartialBinaryComparatorFactory() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory#createBinaryComparator()
+     */
+    @Override
+    public IBinaryComparator createBinaryComparator() {
+        return new IBinaryComparator() {
+
+            @Override
+            public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
+                short pointCount1 = AInt16SerializerDeserializer.getShort(b1, s1);
+                int c = Short.compare(pointCount1, AInt16SerializerDeserializer.getShort(b2, s2));
+
+                if (c == 0) {
+                    int ci = 0;
+                    for (int i = 0; i < pointCount1; i++) {
+                        ci = Double.compare(DoubleSerializerDeserializer.getDouble(b1, s1 + 2 + i * 16),
+                                DoubleSerializerDeserializer.getDouble(b2, s1 + 2 + i * 16));
+                        if (ci == 0) {
+                            ci = Double.compare(DoubleSerializerDeserializer.getDouble(b1, s1 + 10 + i * 16),
+                                    DoubleSerializerDeserializer.getDouble(b2, s1 + 10 + i * 16));
+                            if (ci == 0) {
+                                continue;
+                            }
+                        }
+                        return ci;
+                    }
+                }
+
+                return c;
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/hash/AObjectBinaryHashFunctionFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/hash/AObjectBinaryHashFunctionFactory.java
index 15fd8c8..570d8ae 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/hash/AObjectBinaryHashFunctionFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/hash/AObjectBinaryHashFunctionFactory.java
@@ -44,9 +44,14 @@
                     case BOOLEAN: {
                         return boolHash.hash(bytes, offset + 1, length - 1);
                     }
+                    case TIME:
+                    case DATE:
+                    case YEARMONTHDURATION:
                     case INT32: {
                         return intHash.hash(bytes, offset + 1, length - 1);
                     }
+                    case DATETIME:
+                    case DAYTIMEDURATION:
                     case INT64: {
                         return longHash.hash(bytes, offset + 1, length - 1);
                     }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
new file mode 100644
index 0000000..c596a8c
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADayTimeDurationPrinter.java
@@ -0,0 +1,77 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools;
+
+public class ADayTimeDurationPrinter implements IPrinter {
+
+    public static final ADayTimeDurationPrinter INSTANCE = new ADayTimeDurationPrinter();
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+    
+    @Override
+    public void init() throws AlgebricksException {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        boolean positive = true;
+        long milliseconds = AInt64SerializerDeserializer.getLong(b, s + 1);
+
+        // set the negative flag. "||" is necessary in case that months field is not there (so it is 0)
+        if (milliseconds < 0) {
+            milliseconds *= -1;
+            positive = false;
+        }
+
+        int millisecond = gCalInstance.getDurationMillisecond(milliseconds);
+        int second = gCalInstance.getDurationSecond(milliseconds);
+        int minute = gCalInstance.getDurationMinute(milliseconds);
+        int hour = gCalInstance.getDurationHour(milliseconds);
+        int day = gCalInstance.getDurationDay(milliseconds);
+
+        ps.print("day-time-duration(\"");
+        if (!positive) {
+            ps.print("-");
+        }
+        try {
+            ps.print("P");
+            if (day != 0) {
+                WriteValueTools.writeInt(day, ps);
+                ps.print("D");
+            }
+            if (hour != 0 || minute != 0 || second != 0 || millisecond != 0) {
+                ps.print("T");
+            }
+            if (hour != 0) {
+                WriteValueTools.writeInt(hour, ps);
+                ps.print("H");
+            }
+            if (minute != 0) {
+                WriteValueTools.writeInt(minute, ps);
+                ps.print("M");
+            }
+            if (second != 0 || millisecond != 0) {
+                WriteValueTools.writeInt(second, ps);
+            }
+            if (millisecond > 0) {
+                ps.print(".");
+                WriteValueTools.writeInt(millisecond, ps);
+            }
+            if (second != 0 || millisecond != 0) {
+                ps.print("S");
+            }
+            ps.print("\")");
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AYearMonthDurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AYearMonthDurationPrinter.java
new file mode 100644
index 0000000..29e2529
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AYearMonthDurationPrinter.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools;
+
+public class AYearMonthDurationPrinter implements IPrinter {
+
+    public static final AYearMonthDurationPrinter INSTANCE = new AYearMonthDurationPrinter();
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.algebricks.data.IPrinter#init()
+     */
+    @Override
+    public void init() throws AlgebricksException {
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.algebricks.data.IPrinter#print(byte[], int, int, java.io.PrintStream)
+     */
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        boolean positive = true;
+        int months = AInt32SerializerDeserializer.getInt(b, s + 1);
+
+        // set the negative flag. "||" is necessary in case that months field is not there (so it is 0)
+        if (months < 0) {
+            months *= -1;
+            positive = false;
+        }
+
+        int month = gCalInstance.getDurationMonth(months);
+        int year = gCalInstance.getDurationYear(months);
+
+        ps.print("year-month-duration(\"");
+        if (!positive) {
+            ps.print("-");
+        }
+        try {
+            ps.print("P");
+            if (year != 0) {
+                WriteValueTools.writeInt(year, ps);
+                ps.print("Y");
+            }
+            if (month != 0) {
+                WriteValueTools.writeInt(month, ps);
+                ps.print("M");
+            }
+            ps.print("\")");
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADayTimeDurationSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADayTimeDurationSerializerDeserializer.java
new file mode 100644
index 0000000..b016af0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADayTimeDurationSerializerDeserializer.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.serde;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ADayTimeDuration;
+import edu.uci.ics.asterix.om.base.AMutableDayTimeDuration;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+
+public class ADayTimeDurationSerializerDeserializer implements ISerializerDeserializer<ADayTimeDuration> {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final ADayTimeDurationSerializerDeserializer INSTNACE = new ADayTimeDurationSerializerDeserializer();
+
+    @SuppressWarnings("unchecked")
+    private static final ISerializerDeserializer<ADayTimeDuration> dayTimeDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+            .getSerializerDeserializer(BuiltinType.ADAYTIMEDURATION);
+    private static final AMutableDayTimeDuration aDayTimeDuration = new AMutableDayTimeDuration(0);
+
+    @Override
+    public ADayTimeDuration deserialize(DataInput in) throws HyracksDataException {
+        try {
+            return new ADayTimeDuration(in.readLong());
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    }
+
+    @Override
+    public void serialize(ADayTimeDuration instance, DataOutput out) throws HyracksDataException {
+        try {
+            out.writeLong(instance.getMilliseconds());
+        } catch (IOException e) {
+            throw new HyracksDataException();
+        }
+    }
+
+    public static void parse(String durationString, DataOutput out) throws HyracksDataException {
+        try {
+            ADurationParserFactory.parseDuration(durationString, 0, durationString.length(), aDayTimeDuration,
+                    ADurationParseOption.All);
+            dayTimeDurationSerde.serialize(aDayTimeDuration, out);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
+        }
+    }
+
+    public static long getDayTime(byte[] data, int offset) {
+        return AInt64SerializerDeserializer.getLong(data, offset);
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADurationSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADurationSerializerDeserializer.java
index 6930f60..be50d48 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADurationSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADurationSerializerDeserializer.java
@@ -8,6 +8,7 @@
 import edu.uci.ics.asterix.om.base.ADuration;
 import edu.uci.ics.asterix.om.base.AMutableDuration;
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
@@ -46,7 +47,7 @@
 
     public static void parse(String duration, DataOutput out) throws HyracksDataException {
         try {
-            ADurationParserFactory.parseDuration(duration, 0, duration.length(), aDuration);
+            ADurationParserFactory.parseDuration(duration, 0, duration.length(), aDuration, ADurationParseOption.All);
             durationSerde.serialize(aDuration, out);
         } catch (Exception e) {
             throw new HyracksDataException(e);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
index 2e4f72c..88aa7f4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
@@ -86,6 +86,12 @@
             case DURATION: {
                 return ADurationSerializerDeserializer.INSTANCE.deserialize(in);
             }
+            case YEARMONTHDURATION: {
+                return AYearMonthDurationerializerDeserializer.INSTANCE.deserialize(in);
+            }
+            case DAYTIMEDURATION: {
+                return ADayTimeDurationSerializerDeserializer.INSTNACE.deserialize(in);
+            }
             case INTERVAL: {
                 return AIntervalSerializerDeserializer.INSTANCE.deserialize(in);
             }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AYearMonthDurationerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AYearMonthDurationerializerDeserializer.java
new file mode 100644
index 0000000..79bf3c0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AYearMonthDurationerializerDeserializer.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.dataflow.data.nontagged.serde;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutableYearMonthDuration;
+import edu.uci.ics.asterix.om.base.AYearMonthDuration;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+
+public class AYearMonthDurationerializerDeserializer implements ISerializerDeserializer<AYearMonthDuration> {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final AYearMonthDurationerializerDeserializer INSTANCE = new AYearMonthDurationerializerDeserializer();
+
+    @SuppressWarnings("unchecked")
+    private static final ISerializerDeserializer<AYearMonthDuration> yearMonthDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+            .getSerializerDeserializer(BuiltinType.AYEARMONTHDURATION);
+    private static final AMutableYearMonthDuration aYearMonthDuration = new AMutableYearMonthDuration(0);
+
+    @Override
+    public AYearMonthDuration deserialize(DataInput in) throws HyracksDataException {
+        try {
+            return new AYearMonthDuration(in.readInt());
+        } catch (IOException e) {
+            throw new HyracksDataException(e);
+        }
+    }
+
+    @Override
+    public void serialize(AYearMonthDuration instance, DataOutput out) throws HyracksDataException {
+        try {
+            out.writeInt(instance.getMonths());
+        } catch (IOException e) {
+            throw new HyracksDataException();
+        }
+    }
+
+    public static void parse(String durationString, DataOutput out) throws HyracksDataException {
+        try {
+            ADurationParserFactory.parseDuration(durationString, 0, durationString.length(), aYearMonthDuration,
+                    ADurationParseOption.All);
+            yearMonthDurationSerde.serialize(aYearMonthDuration, out);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
+        }
+    }
+
+    public static int getYearMonth(byte[] data, int offset) {
+        return AInt32SerializerDeserializer.getInt(data, offset);
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
index 02f0e47..18b31ec1 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryComparatorFactoryProvider.java
@@ -2,10 +2,17 @@
 
 import java.io.Serializable;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateOrTimeAscBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateTimeAscBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AObjectAscBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AObjectDescBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APoint3DPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APointPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APolygonPartialBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.BooleanBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.RectangleBinaryComparatorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -102,9 +109,14 @@
             case INT16: {
                 return addOffset(SHORT_POINTABLE_INSTANCE, ascending);
             }
+            case DATE:
+            case TIME:
+            case YEARMONTHDURATION:
             case INT32: {
                 return addOffset(INTEGER_POINTABLE_INSTANCE, ascending);
             }
+            case DATETIME:
+            case DAYTIMEDURATION:
             case INT64: {
                 return addOffset(LONG_POINTABLE_INSTANCE, ascending);
             }
@@ -120,12 +132,26 @@
             case RECTANGLE: {
                 return addOffset(RectangleBinaryComparatorFactory.INSTANCE, ascending);
             }
-            case DATE:
-            case TIME: {
-                return addOffset(ADateOrTimeAscBinaryComparatorFactory.INSTANCE, ascending);
+            case CIRCLE: {
+                return addOffset(ACirclePartialBinaryComparatorFactory.INSTANCE, ascending);
             }
-            case DATETIME: {
-                return addOffset(ADateTimeAscBinaryComparatorFactory.INSTANCE, ascending);
+            case POINT: {
+                return addOffset(APointPartialBinaryComparatorFactory.INSTANCE, ascending);
+            }
+            case POINT3D: {
+                return addOffset(APoint3DPartialBinaryComparatorFactory.INSTANCE, ascending);
+            }
+            case LINE: {
+                return addOffset(ALinePartialBinaryComparatorFactory.INSTANCE, ascending);
+            }
+            case POLYGON: {
+                return addOffset(APolygonPartialBinaryComparatorFactory.INSTANCE, ascending);
+            }
+            case DURATION: {
+                return addOffset(ADurationPartialBinaryComparatorFactory.INSTANCE, ascending);
+            }
+            case INTERVAL: {
+                return addOffset(AIntervalPartialBinaryComparatorFactory.INSTANCE, ascending);
             }
             default: {
                 throw new NotImplementedException("No binary comparator factory implemented for type " + type + " .");
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFactoryProvider.java
index 1afdbf8..cbc4745 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFactoryProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlBinaryHashFunctionFactoryProvider.java
@@ -69,9 +69,14 @@
             case BOOLEAN: {
                 return addOffset(BooleanBinaryHashFunctionFactory.INSTANCE);
             }
+            case DATE:
+            case TIME:
+            case YEARMONTHDURATION:
             case INT32: {
                 return addOffset(new PointableBinaryHashFunctionFactory(IntegerPointable.FACTORY));
             }
+            case DAYTIMEDURATION:
+            case DATETIME:
             case INT64: {
                 return addOffset(LongBinaryHashFunctionFactory.INSTANCE);
             }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
index 29e33fd..92cfc5b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlSerializerDeserializerProvider.java
@@ -9,6 +9,7 @@
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADateTimeSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
@@ -29,6 +30,7 @@
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AStringSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ATimeSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AYearMonthDurationerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.SerializerDeserializerUtil;
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.types.AOrderedListType;
@@ -112,6 +114,12 @@
             case DURATION: {
                 return ADurationSerializerDeserializer.INSTANCE;
             }
+            case YEARMONTHDURATION: {
+                return AYearMonthDurationerializerDeserializer.INSTANCE;
+            }
+            case DAYTIMEDURATION: {
+                return ADayTimeDurationSerializerDeserializer.INSTNACE;
+            }
             case INTERVAL: {
                 return AIntervalSerializerDeserializer.INSTANCE;
             }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADayTimeDuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADayTimeDuration.java
new file mode 100644
index 0000000..03a9627
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADayTimeDuration.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.base;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+
+public class ADayTimeDuration implements IAObject {
+
+    protected long chrononInMillisecond;
+
+    public ADayTimeDuration(long millisecond) {
+        this.chrononInMillisecond = millisecond;
+    }
+
+    public long getMilliseconds() {
+        return chrononInMillisecond;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.JSONSerializable#toJSON()
+     */
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject duration = new JSONObject();
+        duration.put("milliseconds", chrononInMillisecond);
+        json.put("ADuration", duration);
+
+        return json;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#getType()
+     */
+    @Override
+    public IAType getType() {
+        return BuiltinType.ADAYTIMEDURATION;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#accept(edu.uci.ics.asterix.om.visitors.IOMVisitor)
+     */
+    @Override
+    public void accept(IOMVisitor visitor) throws AsterixException {
+        visitor.visitADayTimeDuration(this);
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#deepEqual(edu.uci.ics.asterix.om.base.IAObject)
+     */
+    @Override
+    public boolean deepEqual(IAObject obj) {
+        return equals(obj);
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#hash()
+     */
+    @Override
+    public int hash() {
+        return hashCode();
+    }
+
+    public boolean equals(Object o) {
+        if (o instanceof ADayTimeDuration) {
+            return ((ADayTimeDuration) o).chrononInMillisecond == chrononInMillisecond;
+        }
+        return false;
+    }
+
+    public int hashCode() {
+        return (int) (chrononInMillisecond ^ (chrononInMillisecond >>> 32));
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDayTimeDuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDayTimeDuration.java
new file mode 100644
index 0000000..ebd0a18
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDayTimeDuration.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.base;
+
+public class AMutableDayTimeDuration extends ADayTimeDuration {
+
+    public AMutableDayTimeDuration(long milliseconds) {
+        super(milliseconds);
+    }
+
+    public void setMilliseconds(long milliseconds) {
+        this.chrononInMillisecond = milliseconds;
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableYearMonthDuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableYearMonthDuration.java
new file mode 100644
index 0000000..3a21144
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableYearMonthDuration.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.base;
+
+public class AMutableYearMonthDuration extends AYearMonthDuration {
+
+    public AMutableYearMonthDuration(int months) {
+        super(months);
+    }
+
+    public void setMonths(int months) {
+        this.chrononInMonth = months;
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AYearMonthDuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AYearMonthDuration.java
new file mode 100644
index 0000000..1714bb0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AYearMonthDuration.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.base;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+
+/**
+ * AYearMonthDuration represents the duration in the unit of months.
+ * <p/>
+ * An AYearMonthDuration may contain the following two fields:<br/>
+ * - year;<br/>
+ * - month.
+ * <p/>
+ */
+public class AYearMonthDuration implements IAObject {
+
+    protected int chrononInMonth;
+
+    public AYearMonthDuration(int months) {
+        this.chrononInMonth = months;
+    }
+
+    public int getMonths() {
+        return chrononInMonth;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.hyracks.api.dataflow.value.JSONSerializable#toJSON()
+     */
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject duration = new JSONObject();
+        duration.put("months", chrononInMonth);
+        json.put("ADuration", duration);
+
+        return json;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#getType()
+     */
+    @Override
+    public IAType getType() {
+        return BuiltinType.AYEARMONTHDURATION;
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#accept(edu.uci.ics.asterix.om.visitors.IOMVisitor)
+     */
+    @Override
+    public void accept(IOMVisitor visitor) throws AsterixException {
+        visitor.visitAYearMonthDuration(this);
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#deepEqual(edu.uci.ics.asterix.om.base.IAObject)
+     */
+    @Override
+    public boolean deepEqual(IAObject obj) {
+        return equals(obj);
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.base.IAObject#hash()
+     */
+    @Override
+    public int hash() {
+        return hashCode();
+    }
+
+    public boolean equals(Object o) {
+        if (o instanceof AYearMonthDuration) {
+            return ((AYearMonthDuration) o).chrononInMonth == chrononInMonth;
+        }
+        return false;
+    }
+
+    public int hashCode() {
+        return chrononInMonth;
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParserFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParserFactory.java
index de5a6a1..84e2386 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParserFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParserFactory.java
@@ -17,7 +17,10 @@
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.om.base.AMutableDayTimeDuration;
 import edu.uci.ics.asterix.om.base.AMutableDuration;
+import edu.uci.ics.asterix.om.base.AMutableYearMonthDuration;
+import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
@@ -28,7 +31,11 @@
 
     private static final long serialVersionUID = 1L;
 
-    private static final String durationErrorMessage = "Wrong Input Format for a Duration Value";
+    private static final String durationErrorMessage = "Wrong Input Format for a duration/year-month-duration/day-time-duration Value";
+    private static final String onlyYearMonthErrorMessage = "Only year-month fields are allowed";
+    private static final String onlyDayTimeErrorMessage = "Only day-time fields are allowed";
+
+    private static final int DECIMAL_UNIT = 10;
 
     private ADurationParserFactory() {
 
@@ -41,7 +48,7 @@
 
             @Override
             public void parse(char[] buffer, int start, int length, DataOutput out) throws HyracksDataException {
-                parseDuration(buffer, start, length, aMutableDuration);
+                parseDuration(buffer, start, length, aMutableDuration, ADurationParseOption.All);
                 try {
                     out.writeInt(aMutableDuration.getMonths());
                     out.writeLong(aMutableDuration.getMilliseconds());
@@ -64,299 +71,75 @@
         SEC;
     };
 
-    public static void parseDuration(String durationString, int start, int length, AMutableDuration aDuration)
-            throws HyracksDataException {
-
-        boolean positive = true;
-        int offset = 0;
-        int value = 0, hour = 0, minute = 0, second = 0, millisecond = 0, year = 0, month = 0, day = 0;
-        State state = State.NOTHING_READ;
-
-        if (durationString.charAt(start + offset) == '-') {
-            offset++;
-            positive = false;
-        }
-
-        if (durationString.charAt(start + offset) != 'P') {
-            throw new HyracksDataException(durationErrorMessage + ": Missing leading 'P'.");
-        }
-
-        offset++;
-
-        for (; offset < length; offset++) {
-            if (durationString.charAt(start + offset) >= '0' && durationString.charAt(start + offset) <= '9') {
-                // accumulate the digit fields
-                value = value * 10 + durationString.charAt(start + offset) - '0';
-            } else {
-                switch (durationString.charAt(start + offset)) {
-                    case 'Y':
-                        if (state.compareTo(State.YEAR) < 0) {
-                            year = value;
-                            state = State.YEAR;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong YEAR feild.");
-                        }
-                        break;
-                    case 'M':
-                        if (state.compareTo(State.TIME) < 0) {
-                            if (state.compareTo(State.MONTH) < 0) {
-                                month = value;
-                                state = State.MONTH;
-                            } else {
-                                throw new HyracksDataException(durationErrorMessage + ": wrong MONTH field.");
-                            }
-                        } else if (state.compareTo(State.MIN) < 0) {
-                            minute = value;
-                            state = State.MIN;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong MIN field.");
-                        }
-                        break;
-                    case 'D':
-                        if (state.compareTo(State.DAY) < 0) {
-                            day = value;
-                            state = State.DAY;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong DAY field");
-                        }
-                        break;
-                    case 'T':
-                        if (state.compareTo(State.TIME) < 0) {
-                            state = State.TIME;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong TIME field.");
-                        }
-                        break;
-
-                    case 'H':
-                        if (state.compareTo(State.HOUR) < 0) {
-                            hour = value;
-                            state = State.HOUR;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong HOUR field.");
-                        }
-                        break;
-                    case '.':
-                        if (state.compareTo(State.MILLISEC) < 0) {
-                            int i = 1;
-                            for (; offset + i < length; i++) {
-                                if (durationString.charAt(start + offset + i) >= '0'
-                                        && durationString.charAt(start + offset + i) <= '9') {
-                                    if (i < 4) {
-                                        millisecond = millisecond * 10
-                                                + (durationString.charAt(start + offset + i) - '0');
-                                    } else {
-                                        throw new HyracksDataException(durationErrorMessage
-                                                + ": wrong MILLISECOND field.");
-                                    }
-                                } else {
-                                    break;
-                                }
-                            }
-                            offset += i;
-                            state = State.MILLISEC;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong MILLISECOND field.");
-                        }
-                    case 'S':
-                        if (state.compareTo(State.SEC) < 0) {
-                            second = value;
-                            state = State.SEC;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong SECOND field.");
-                        }
-                        break;
-                    default:
-                        throw new HyracksDataException(durationErrorMessage + ": wrong format for duration.");
-
-                }
-                value = 0;
-            }
-        }
-
-        if (state.compareTo(State.TIME) == 0) {
-            throw new HyracksDataException(durationErrorMessage + ": no time fields after time separator.");
-        }
-
-        short temp = 1;
-        if (!positive) {
-            temp = -1;
-        }
-
-        aDuration.setValue(temp * (year * 12 + month), temp
-                * (day * 24 * 3600 * 1000L + 3600 * 1000L * hour + 60 * minute * 1000L + second * 1000L + millisecond));
-
+    public enum ADurationParseOption {
+        YEAR_MONTH,
+        DAY_TIME,
+        All
     }
 
-    /**
-     * Copy-and-paste the code in {@link #parseDuration(String, int, int, AMutableDuration)} in order to eliminate
-     * object creation.
-     * 
-     * @param charAccessor
-     * @param start
-     * @param length
-     * @param aDuration
-     * @throws HyracksDataException
-     */
-    public static void parseDuration(char[] charAccessor, int start, int length, AMutableDuration aDuration)
-            throws HyracksDataException {
-
-        boolean positive = true;
-        int offset = 0;
-        int value = 0, hour = 0, minute = 0, second = 0, millisecond = 0, year = 0, month = 0, day = 0;
-        State state = State.NOTHING_READ;
-
-        if (charAccessor[start + offset] == '-') {
-            offset++;
-            positive = false;
-        }
-
-        if (charAccessor[start + offset] != 'P') {
-            throw new HyracksDataException(durationErrorMessage + ": Missing leading 'P'.");
-        }
-
-        offset++;
-
-        for (; offset < length; offset++) {
-            if (charAccessor[start + offset] >= '0' && charAccessor[start + offset] <= '9') {
-                // accumulate the digit fields
-                value = value * 10 + charAccessor[start + offset] - '0';
-            } else {
-                switch (charAccessor[start + offset]) {
-                    case 'Y':
-                        if (state.compareTo(State.YEAR) < 0) {
-                            year = value;
-                            state = State.YEAR;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong YEAR feild.");
-                        }
-                        break;
-                    case 'M':
-                        if (state.compareTo(State.TIME) < 0) {
-                            if (state.compareTo(State.MONTH) < 0) {
-                                month = value;
-                                state = State.MONTH;
-                            } else {
-                                throw new HyracksDataException(durationErrorMessage + ": wrong MONTH field.");
-                            }
-                        } else if (state.compareTo(State.MIN) < 0) {
-                            minute = value;
-                            state = State.MIN;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong MIN field.");
-                        }
-                        break;
-                    case 'D':
-                        if (state.compareTo(State.DAY) < 0) {
-                            day = value;
-                            state = State.DAY;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong DAY field");
-                        }
-                        break;
-                    case 'T':
-                        if (state.compareTo(State.TIME) < 0) {
-                            state = State.TIME;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong TIME field.");
-                        }
-                        break;
-
-                    case 'H':
-                        if (state.compareTo(State.HOUR) < 0) {
-                            hour = value;
-                            state = State.HOUR;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong HOUR field.");
-                        }
-                        break;
-                    case '.':
-                        if (state.compareTo(State.MILLISEC) < 0) {
-                            int i = 1;
-                            for (; offset + i < length; i++) {
-                                if (charAccessor[start + offset + i] >= '0' && charAccessor[start + offset + i] <= '9') {
-                                    if (i < 4) {
-                                        millisecond = millisecond * 10 + (charAccessor[start + offset + i] - '0');
-                                    } else {
-                                        throw new HyracksDataException(durationErrorMessage
-                                                + ": wrong MILLISECOND field.");
-                                    }
-                                } else {
-                                    break;
-                                }
-                            }
-                            offset += i;
-                            state = State.MILLISEC;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong MILLISECOND field.");
-                        }
-                    case 'S':
-                        if (state.compareTo(State.SEC) < 0) {
-                            second = value;
-                            state = State.SEC;
-                        } else {
-                            throw new HyracksDataException(durationErrorMessage + ": wrong SECOND field.");
-                        }
-                        break;
-                    default:
-                        throw new HyracksDataException(durationErrorMessage + ": wrong format for duration.");
-
-                }
-                value = 0;
-            }
-        }
-
-        if (state.compareTo(State.TIME) == 0) {
-            throw new HyracksDataException(durationErrorMessage + ": no time fields after time separator.");
-        }
-
-        short temp = 1;
-        if (!positive) {
-            temp = -1;
-        }
-
-        aDuration.setValue(temp * (year * 12 + month), temp
-                * (day * 24 * 3600 * 1000L + 3600 * 1000L * hour + 60 * minute * 1000L + second * 1000L + millisecond));
-
+    interface IStringAccessor {
+        char getCharAt(int index);
     }
 
-    /**
-     * Copy-and-paste the code in {@link #parseDuration(String, int, int, AMutableDuration)} in order to eliminate
-     * object creation.
-     * 
-     * @param charAccessor
-     * @param start
-     * @param length
-     * @param aDuration
-     * @throws HyracksDataException
-     */
-    public static void parseDuration(byte[] charAccessor, int start, int length, AMutableDuration aDuration)
-            throws HyracksDataException {
+    public static void parseDuration(final Object durationString, final int start, int length, IAObject mutableObject,
+            ADurationParseOption parseOption) throws HyracksDataException {
 
-        boolean positive = true;
         int offset = 0;
         int value = 0, hour = 0, minute = 0, second = 0, millisecond = 0, year = 0, month = 0, day = 0;
         State state = State.NOTHING_READ;
 
-        if (charAccessor[start + offset] == '-') {
-            offset++;
-            positive = false;
+        IStringAccessor charAccessor;
+
+        if (durationString instanceof char[]) {
+            charAccessor = new IStringAccessor() {
+                @Override
+                public char getCharAt(int index) {
+                    return ((char[]) durationString)[start + index];
+                }
+            };
+        } else if (durationString instanceof byte[]) {
+            charAccessor = new IStringAccessor() {
+
+                @Override
+                public char getCharAt(int index) {
+                    return (char) (((byte[]) durationString)[start + index]);
+                }
+            };
+        } else if (durationString instanceof String) {
+            charAccessor = new IStringAccessor() {
+
+                @Override
+                public char getCharAt(int index) {
+                    return ((String) durationString).charAt(start + index);
+                }
+            };
+        } else {
+            throw new HyracksDataException(durationErrorMessage);
         }
 
-        if (charAccessor[start + offset] != 'P') {
+        short sign = 1;
+        if (charAccessor.getCharAt(offset) == '-') {
+            offset++;
+            sign = -1;
+        }
+
+        if (charAccessor.getCharAt(offset) != 'P') {
             throw new HyracksDataException(durationErrorMessage + ": Missing leading 'P'.");
         }
 
         offset++;
 
         for (; offset < length; offset++) {
-            if (charAccessor[start + offset] >= '0' && charAccessor[start + offset] <= '9') {
+            if (charAccessor.getCharAt(offset) >= '0' && charAccessor.getCharAt(offset) <= '9') {
                 // accumulate the digit fields
-                value = value * 10 + charAccessor[start + offset] - '0';
+                value = value * DECIMAL_UNIT + charAccessor.getCharAt(offset) - '0';
             } else {
-                switch (charAccessor[start + offset]) {
+                switch (charAccessor.getCharAt(offset)) {
                     case 'Y':
                         if (state.compareTo(State.YEAR) < 0) {
+                            if (parseOption == ADurationParseOption.DAY_TIME) {
+                                throw new HyracksDataException(onlyDayTimeErrorMessage);
+                            }
                             year = value;
                             state = State.YEAR;
                         } else {
@@ -366,12 +149,18 @@
                     case 'M':
                         if (state.compareTo(State.TIME) < 0) {
                             if (state.compareTo(State.MONTH) < 0) {
+                                if (parseOption == ADurationParseOption.DAY_TIME) {
+                                    throw new HyracksDataException(onlyDayTimeErrorMessage);
+                                }
                                 month = value;
                                 state = State.MONTH;
                             } else {
                                 throw new HyracksDataException(durationErrorMessage + ": wrong MONTH field.");
                             }
                         } else if (state.compareTo(State.MIN) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             minute = value;
                             state = State.MIN;
                         } else {
@@ -380,6 +169,9 @@
                         break;
                     case 'D':
                         if (state.compareTo(State.DAY) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             day = value;
                             state = State.DAY;
                         } else {
@@ -388,6 +180,9 @@
                         break;
                     case 'T':
                         if (state.compareTo(State.TIME) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             state = State.TIME;
                         } else {
                             throw new HyracksDataException(durationErrorMessage + ": wrong TIME field.");
@@ -396,6 +191,9 @@
 
                     case 'H':
                         if (state.compareTo(State.HOUR) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             hour = value;
                             state = State.HOUR;
                         } else {
@@ -404,11 +202,16 @@
                         break;
                     case '.':
                         if (state.compareTo(State.MILLISEC) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             int i = 1;
                             for (; offset + i < length; i++) {
-                                if (charAccessor[start + offset + i] >= '0' && charAccessor[start + offset + i] <= '9') {
+                                if (charAccessor.getCharAt(offset + i) >= '0'
+                                        && charAccessor.getCharAt(offset + i) <= '9') {
                                     if (i < 4) {
-                                        millisecond = millisecond * 10 + (charAccessor[start + offset + i] - '0');
+                                        millisecond = millisecond * DECIMAL_UNIT
+                                                + (charAccessor.getCharAt(offset + i) - '0');
                                     } else {
                                         throw new HyracksDataException(durationErrorMessage
                                                 + ": wrong MILLISECOND field.");
@@ -424,6 +227,9 @@
                         }
                     case 'S':
                         if (state.compareTo(State.SEC) < 0) {
+                            if (parseOption == ADurationParseOption.YEAR_MONTH) {
+                                throw new HyracksDataException(onlyYearMonthErrorMessage);
+                            }
                             second = value;
                             state = State.SEC;
                         } else {
@@ -442,13 +248,18 @@
             throw new HyracksDataException(durationErrorMessage + ": no time fields after time separator.");
         }
 
-        short temp = 1;
-        if (!positive) {
-            temp = -1;
+        if (mutableObject instanceof AMutableDuration) {
+            ((AMutableDuration) mutableObject)
+                    .setValue(sign * (year * 12 + month),
+                            sign
+                                    * (day * 24 * 3600 * 1000L + 3600 * 1000L * hour + 60 * minute * 1000L + second
+                                            * 1000L + millisecond));
+        } else if (mutableObject instanceof AMutableYearMonthDuration) {
+            ((AMutableYearMonthDuration) mutableObject).setMonths(sign * (year * 12 + month));
+        } else if (mutableObject instanceof AMutableDayTimeDuration) {
+            ((AMutableDayTimeDuration) mutableObject)
+                    .setMilliseconds(sign
+                            * (day * 24 * 3600 * 1000L + 3600 * 1000L * hour + 60 * minute * 1000L + second * 1000L + millisecond));
         }
-
-        aDuration.setValue(temp * (year * 12 + month), temp
-                * (day * 24 * 3600 * 1000L + 3600 * 1000L * hour + 60 * minute * 1000L + second * 1000L + millisecond));
-
     }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
index bea62dc..d0bdd16 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/functions/AsterixBuiltinFunctions.java
@@ -48,6 +48,7 @@
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalACircleTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalADateTimeTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalADateTypeComputer;
+import edu.uci.ics.asterix.om.typecomputer.impl.OptionalADayTimeDurationTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalADoubleTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalADurationTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalAFloatTypeComputer;
@@ -64,6 +65,7 @@
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalAStringTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalATemporalInstanceTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OptionalATimeTypeComputer;
+import edu.uci.ics.asterix.om.typecomputer.impl.OptionalAYearMonthDurationTypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListConstructorResultType;
 import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAInt32TypeComputer;
 import edu.uci.ics.asterix.om.typecomputer.impl.OrderedListOfAPointTypeComputer;
@@ -372,6 +374,10 @@
             "datetime", 1);
     public final static FunctionIdentifier DURATION_CONSTRUCTOR = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
             "duration", 1);
+    public final static FunctionIdentifier YEAR_MONTH_DURATION_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionConstants.ASTERIX_NS, "year-month-duration", 1);
+    public final static FunctionIdentifier DAY_TIME_DURATION_CONSTRUCTOR = new FunctionIdentifier(
+            FunctionConstants.ASTERIX_NS, "day-time-duration", 1);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_DATE = new FunctionIdentifier(
             FunctionConstants.ASTERIX_NS, "interval-from-date", 2);
     public final static FunctionIdentifier INTERVAL_CONSTRUCTOR_TIME = new FunctionIdentifier(
@@ -427,12 +433,16 @@
             FunctionConstants.ASTERIX_NS, "day-time-duration-less-than", 2);
     public final static FunctionIdentifier DURATION_FROM_MONTHS = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
             "duration-from-months", 1);
-    public final static FunctionIdentifier MONTHS_OF_YEAR_MONTH_DURATION = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "months-of-year-month-duration", 1);
+    public final static FunctionIdentifier MONTHS_FROM_YEAR_MONTH_DURATION = new FunctionIdentifier(
+            FunctionConstants.ASTERIX_NS, "months-from-year-month-duration", 1);
     public final static FunctionIdentifier DURATION_FROM_MILLISECONDS = new FunctionIdentifier(
             FunctionConstants.ASTERIX_NS, "duration-from-ms", 1);
-    public final static FunctionIdentifier MILLISECONDS_OF_DAY_TIME_DURATION = new FunctionIdentifier(
-            FunctionConstants.ASTERIX_NS, "ms-of-day-time-duration", 1);
+    public final static FunctionIdentifier MILLISECONDS_FROM_DAY_TIME_DURATION = new FunctionIdentifier(
+            FunctionConstants.ASTERIX_NS, "ms-from-day-time-duration", 1);
+    public final static FunctionIdentifier GET_YEAR_MONTH_DURATION = new FunctionIdentifier(
+            FunctionConstants.ASTERIX_NS, "get-year-month-duration", 1);
+    public final static FunctionIdentifier GET_DAY_TIME_DURATION = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
+            "get-day-time-duration", 1);
 
     // spatial
     public final static FunctionIdentifier CREATE_POINT = new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
@@ -612,6 +622,8 @@
         add(DATETIME_CONSTRUCTOR, OptionalADateTimeTypeComputer.INSTANCE);
         add(DOUBLE_CONSTRUCTOR, OptionalADoubleTypeComputer.INSTANCE);
         add(DURATION_CONSTRUCTOR, OptionalADurationTypeComputer.INSTANCE);
+        add(YEAR_MONTH_DURATION_CONSTRUCTOR, OptionalAYearMonthDurationTypeComputer.INSTANCE);
+        add(DAY_TIME_DURATION_CONSTRUCTOR, OptionalADayTimeDurationTypeComputer.INSTANCE);
         add(EDIT_DISTANCE, AInt32TypeComputer.INSTANCE);
         add(EDIT_DISTANCE_CHECK, OrderedListOfAnyTypeComputer.INSTANCE);
         add(EDIT_DISTANCE_STRING_IS_FILTERABLE, ABooleanTypeComputer.INSTANCE);
@@ -844,8 +856,10 @@
         add(DURATION_EQUAL, OptionalABooleanTypeComputer.INSTANCE);
         add(DURATION_FROM_MONTHS, OptionalADurationTypeComputer.INSTANCE);
         add(DURATION_FROM_MILLISECONDS, OptionalADurationTypeComputer.INSTANCE);
-        add(MONTHS_OF_YEAR_MONTH_DURATION, OptionalAInt32TypeComputer.INSTANCE);
-        add(MILLISECONDS_OF_DAY_TIME_DURATION, OptionalAInt64TypeComputer.INSTANCE);
+        add(MONTHS_FROM_YEAR_MONTH_DURATION, OptionalAInt32TypeComputer.INSTANCE);
+        add(MILLISECONDS_FROM_DAY_TIME_DURATION, OptionalAInt64TypeComputer.INSTANCE);
+        add(GET_DAY_TIME_DURATION, OptionalADayTimeDurationTypeComputer.INSTANCE);
+        add(GET_YEAR_MONTH_DURATION, OptionalAYearMonthDurationTypeComputer.INSTANCE);
 
         // interval constructors
         add(INTERVAL_CONSTRUCTOR_DATE, OptionalAIntervalTypeComputer.INSTANCE);
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
index b78308d..cdbf5ca 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/APrintVisitor.java
@@ -24,6 +24,7 @@
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ACirclePrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADatePrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADateTimePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADayTimeDurationPrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADoublePrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ADurationPrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AFloatPrinter;
@@ -40,6 +41,7 @@
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ARectanglePrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AStringPrinter;
 import edu.uci.ics.asterix.dataflow.data.nontagged.printers.ATimePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.AYearMonthDurationPrinter;
 import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
 import edu.uci.ics.asterix.om.pointables.AListPointable;
 import edu.uci.ics.asterix.om.pointables.ARecordPointable;
@@ -146,6 +148,14 @@
                     ADurationPrinter.INSTANCE.print(b, s, l, ps);
                     break;
                 }
+                case YEARMONTHDURATION: {
+                    AYearMonthDurationPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case DAYTIMEDURATION: {
+                    ADayTimeDurationPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
                 case POINT: {
                     APointPrinter.INSTANCE.print(b, s, l, ps);
                     break;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalADayTimeDurationTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalADayTimeDurationTypeComputer.java
new file mode 100644
index 0000000..38f76e3
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalADayTimeDurationTypeComputer.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.typecomputer.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
+
+public class OptionalADayTimeDurationTypeComputer implements IResultTypeComputer {
+
+    public static final OptionalADayTimeDurationTypeComputer INSTANCE = new OptionalADayTimeDurationTypeComputer();
+
+    private OptionalADayTimeDurationTypeComputer() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer#computeType(edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression, edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment, edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)
+     */
+    @Override
+    public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
+            IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
+        List<IAType> unionList = new ArrayList<IAType>();
+        unionList.add(BuiltinType.ANULL);
+        unionList.add(BuiltinType.ADAYTIMEDURATION);
+        return new AUnionType(unionList, "OptionalDayTimeDuration");
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalAYearMonthDurationTypeComputer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalAYearMonthDurationTypeComputer.java
new file mode 100644
index 0000000..4c08142
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/typecomputer/impl/OptionalAYearMonthDurationTypeComputer.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.om.typecomputer.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment;
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider;
+
+public class OptionalAYearMonthDurationTypeComputer implements IResultTypeComputer {
+
+    public static final OptionalAYearMonthDurationTypeComputer INSTANCE = new OptionalAYearMonthDurationTypeComputer();
+
+    private OptionalAYearMonthDurationTypeComputer() {
+
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.typecomputer.base.IResultTypeComputer#computeType(edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression, edu.uci.ics.hyracks.algebricks.core.algebra.expressions.IVariableTypeEnvironment, edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IMetadataProvider)
+     */
+    @Override
+    public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env,
+            IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
+        List<IAType> unionList = new ArrayList<IAType>();
+        unionList.add(BuiltinType.ANULL);
+        unionList.add(BuiltinType.AYEARMONTHDURATION);
+        return new AUnionType(unionList, "OptionalYearMonthDuration");
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
index ca7bc24..037cd29 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
@@ -259,6 +259,11 @@
                 case FLOAT:
                 case DOUBLE:
                 case STRING:
+                case DATE:
+                case TIME:
+                case DATETIME:
+                case YEARMONTHDURATION:
+                case DAYTIMEDURATION:
                     break;
                 case UNION:
                     throw new AlgebricksException("The partitioning key \"" + fieldName + "\" cannot be nullable");
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
index a0ad3e1..e88596d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ATypeTag.java
@@ -1,6 +1,4 @@
-/**
- * 
- */
+
 package edu.uci.ics.asterix.om.types;
 
 /**
@@ -44,7 +42,9 @@
     CIRCLE(32),
     RECTANGLE(33),
     INTERVAL(34),
-    SYSTEM_NULL(35);
+    SYSTEM_NULL(35),
+    YEARMONTHDURATION(36),
+    DAYTIMEDURATION(37);
 
     private byte value;
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
index a70f15b..17d98d4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
@@ -431,6 +431,60 @@
         }
     };
 
+    public final static BuiltinType AYEARMONTHDURATION = new LowerCaseConstructorType() {
+
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String getDisplayName() {
+            return "AYearMonthDuration";
+        }
+
+        @Override
+        public ATypeTag getTypeTag() {
+            return ATypeTag.YEARMONTHDURATION;
+        }
+
+        @Override
+        public String getTypeName() {
+            return "year-month-duration";
+        }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AYearMonthDuration");
+            return type;
+        }
+    };
+
+    public final static BuiltinType ADAYTIMEDURATION = new LowerCaseConstructorType() {
+
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String getDisplayName() {
+            return "ADayTimeDuration";
+        }
+
+        @Override
+        public ATypeTag getTypeTag() {
+            return ATypeTag.DAYTIMEDURATION;
+        }
+
+        @Override
+        public String getTypeName() {
+            return "day-time-duration";
+        }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ADayTimeDuration");
+            return type;
+        }
+    };
+
     public final static BuiltinType AINTERVAL = new LowerCaseConstructorType() {
 
         private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
index 047c459..b4cd23c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/util/NonTaggedFormatUtil.java
@@ -95,12 +95,14 @@
             case INT32:
             case FLOAT:
             case DATE:
+            case YEARMONTHDURATION:
                 return 4;
             case TIME:
                 return 4;
             case INT64:
             case DOUBLE:
             case DATETIME:
+            case DAYTIMEDURATION:
                 return 8;
             case DURATION:
                 return 12;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/IOMVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/IOMVisitor.java
index 703b792..d83f72d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/IOMVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/IOMVisitor.java
@@ -7,6 +7,7 @@
 import edu.uci.ics.asterix.om.base.ACircle;
 import edu.uci.ics.asterix.om.base.ADate;
 import edu.uci.ics.asterix.om.base.ADateTime;
+import edu.uci.ics.asterix.om.base.ADayTimeDuration;
 import edu.uci.ics.asterix.om.base.ADouble;
 import edu.uci.ics.asterix.om.base.ADuration;
 import edu.uci.ics.asterix.om.base.AFloat;
@@ -26,6 +27,7 @@
 import edu.uci.ics.asterix.om.base.AString;
 import edu.uci.ics.asterix.om.base.ATime;
 import edu.uci.ics.asterix.om.base.AUnorderedList;
+import edu.uci.ics.asterix.om.base.AYearMonthDuration;
 import edu.uci.ics.asterix.om.types.IAType;
 
 public interface IOMVisitor {
@@ -47,6 +49,10 @@
 
     public void visitADuration(ADuration obj) throws AsterixException;
 
+    public void visitAYearMonthDuration(AYearMonthDuration obj) throws AsterixException;
+
+    public void visitADayTimeDuration(ADayTimeDuration obj) throws AsterixException;
+
     public void visitAInterval(AInterval obj) throws AsterixException;
 
     public void visitADate(ADate obj) throws AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/OMPrintToStringVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/OMPrintToStringVisitor.java
index e7856f0..60c8700 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/OMPrintToStringVisitor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/visitors/OMPrintToStringVisitor.java
@@ -8,6 +8,7 @@
 import edu.uci.ics.asterix.om.base.ACollectionCursor;
 import edu.uci.ics.asterix.om.base.ADate;
 import edu.uci.ics.asterix.om.base.ADateTime;
+import edu.uci.ics.asterix.om.base.ADayTimeDuration;
 import edu.uci.ics.asterix.om.base.ADouble;
 import edu.uci.ics.asterix.om.base.ADuration;
 import edu.uci.ics.asterix.om.base.AFloat;
@@ -27,6 +28,7 @@
 import edu.uci.ics.asterix.om.base.AString;
 import edu.uci.ics.asterix.om.base.ATime;
 import edu.uci.ics.asterix.om.base.AUnorderedList;
+import edu.uci.ics.asterix.om.base.AYearMonthDuration;
 import edu.uci.ics.asterix.om.base.IACursor;
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.types.ARecordType;
@@ -252,4 +254,16 @@
         }
     }
 
+    @Override
+    public void visitAYearMonthDuration(AYearMonthDuration obj) throws AsterixException {
+        // TODO Auto-generated method stub
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void visitADayTimeDuration(ADayTimeDuration obj) throws AsterixException {
+        // TODO Auto-generated method stub
+        throw new NotImplementedException();
+    }
+
 }
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
index 1565cb9..b13c7cc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/AbstractComparisonEvaluator.java
@@ -2,8 +2,14 @@
 
 import java.io.DataOutput;
 
-import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateOrTimeAscBinaryComparatorFactory;
-import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADateTimeAscBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ACirclePartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ADurationPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.AIntervalPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.ALinePartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APoint3DPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APointPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.APolygonPartialBinaryComparatorFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.comparators.RectangleBinaryComparatorFactory;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -49,9 +55,21 @@
             .getSerializerDeserializer(BuiltinType.ANULL);
     protected IBinaryComparator strBinaryComp = AqlBinaryComparatorFactoryProvider.UTF8STRING_POINTABLE_INSTANCE
             .createBinaryComparator();
-    protected IBinaryComparator dateTimeBinaryComp = ADateTimeAscBinaryComparatorFactory.INSTANCE
+    protected IBinaryComparator circleBinaryComp = ACirclePartialBinaryComparatorFactory.INSTANCE
             .createBinaryComparator();
-    protected IBinaryComparator dateOrTimeBinaryComp = ADateOrTimeAscBinaryComparatorFactory.INSTANCE
+    protected IBinaryComparator durationBinaryComp = ADurationPartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator intervalBinaryComp = AIntervalPartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator lineBinaryComparator = ALinePartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator pointBinaryComparator = APointPartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator point3DBinaryComparator = APoint3DPartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator polygonBinaryComparator = APolygonPartialBinaryComparatorFactory.INSTANCE
+            .createBinaryComparator();
+    protected IBinaryComparator rectangleBinaryComparator = RectangleBinaryComparatorFactory.INSTANCE
             .createBinaryComparator();
 
     public AbstractComparisonEvaluator(DataOutput out, ICopyEvaluatorFactory evalLeftFactory,
@@ -68,6 +86,25 @@
         evalRight.evaluate(tuple);
     }
 
+    protected void checkComparable() throws AlgebricksException {
+        if (outLeft.getLength() != 0) {
+            ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outLeft.getByteArray()[0]);
+            switch (typeTag) {
+                case DURATION:
+                case INTERVAL:
+                case LINE:
+                case POINT:
+                case POINT3D:
+                case POLYGON:
+                case CIRCLE:
+                case RECTANGLE:
+                    throw new AlgebricksException("Inequality comparison for " + typeTag + " is not defined.");
+                default:
+                    return;
+            }
+        }
+    }
+
     protected ComparisonResult compareResults() throws AlgebricksException {
         boolean isLeftNull = false;
         boolean isRightNull = false;
@@ -119,50 +156,73 @@
             case BOOLEAN: {
                 return compareBooleanWithArg(typeTag2);
             }
-            case DATETIME: {
-                return compareDateTimeWithArg(typeTag2);
-            }
-            case DATE:
-            case TIME: {
-                return compareDateOrTimeWithArg(typeTag2);
-            }
+
             default: {
-                throw new AlgebricksException("Comparison is undefined between types " + typeTag1 + " and " + typeTag2
-                        + " .");
+                return compareStrongTypedWithArg(typeTag1, typeTag2);
             }
         }
     }
 
-    private ComparisonResult compareDateOrTimeWithArg(ATypeTag typeTag2) throws AlgebricksException {
-        if (typeTag2 == ATypeTag.NULL) {
-            return ComparisonResult.GREATER_THAN;
-        } else if (typeTag2 == ATypeTag.DATE || typeTag2 == ATypeTag.TIME) {
-            int result = dateOrTimeBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
-                    outRight.getByteArray(), 1, outRight.getLength() - 1);
-            if (result == 0)
-                return ComparisonResult.EQUAL;
-            else if (result < 0)
-                return ComparisonResult.LESS_THAN;
-            else
-                return ComparisonResult.GREATER_THAN;
+    private ComparisonResult compareStrongTypedWithArg(ATypeTag expectedTypeTag, ATypeTag actualTypeTag)
+            throws AlgebricksException {
+        if (expectedTypeTag != actualTypeTag) {
+            throw new AlgebricksException("Comparison is undefined between " + expectedTypeTag + " and "
+                    + actualTypeTag + ".");
         }
-        throw new AlgebricksException("Comparison is undefined between types Date/Time and " + typeTag2 + " .");
-    }
-
-    private ComparisonResult compareDateTimeWithArg(ATypeTag typeTag2) throws AlgebricksException {
-        if (typeTag2 == ATypeTag.NULL) {
-            return ComparisonResult.GREATER_THAN;
-        } else if (typeTag2 == ATypeTag.DATETIME) {
-            int result = dateTimeBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
-                    outRight.getByteArray(), 1, outRight.getLength() - 1);
-            if (result == 0)
-                return ComparisonResult.EQUAL;
-            else if (result < 0)
-                return ComparisonResult.LESS_THAN;
-            else
-                return ComparisonResult.GREATER_THAN;
+        int result = 0;
+        switch (actualTypeTag) {
+            case YEARMONTHDURATION:
+            case TIME:
+            case DATE:
+                result = Integer.compare(AInt32SerializerDeserializer.getInt(outLeft.getByteArray(), 1),
+                        AInt32SerializerDeserializer.getInt(outRight.getByteArray(), 1));
+                break;
+            case DAYTIMEDURATION:
+            case DATETIME:
+                result = Long.compare(AInt64SerializerDeserializer.getLong(outLeft.getByteArray(), 1),
+                        AInt64SerializerDeserializer.getLong(outRight.getByteArray(), 1));
+                break;
+            case CIRCLE:
+                result = circleBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case LINE:
+                result = lineBinaryComparator.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case POINT:
+                result = pointBinaryComparator.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case POINT3D:
+                result = point3DBinaryComparator.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case POLYGON:
+                result = polygonBinaryComparator.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case DURATION:
+                result = durationBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case INTERVAL:
+                result = intervalBinaryComp.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            case RECTANGLE:
+                result = rectangleBinaryComparator.compare(outLeft.getByteArray(), 1, outLeft.getLength() - 1,
+                        outRight.getByteArray(), 1, outRight.getLength() - 1);
+                break;
+            default:
+                throw new AlgebricksException("Comparison for " + actualTypeTag + " is not supported.");
         }
-        throw new AlgebricksException("Comparison is undefined between types Datetime and " + typeTag2 + " .");
+        if (result == 0)
+            return ComparisonResult.EQUAL;
+        else if (result < 0)
+            return ComparisonResult.LESS_THAN;
+        else
+            return ComparisonResult.GREATER_THAN;
     }
 
     private ComparisonResult compareBooleanWithArg(ATypeTag typeTag2) throws AlgebricksException {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
index ed77276..8d57c2e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/comparisons/ComparisonEvalFactory.java
@@ -121,6 +121,7 @@
         @Override
         public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
             evalInputs(tuple);
+            checkComparable();
             ComparisonResult r = compareResults();
             if (r == ComparisonResult.UNKNOWN) {
                 try {
@@ -150,6 +151,7 @@
         @Override
         public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
             evalInputs(tuple);
+            checkComparable();
             ComparisonResult r = compareResults();
             if (r == ComparisonResult.UNKNOWN) {
                 try {
@@ -178,6 +180,7 @@
         @Override
         public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
             evalInputs(tuple);
+            checkComparable();
             ComparisonResult r = compareResults();
             if (r == ComparisonResult.UNKNOWN) {
                 try {
@@ -207,6 +210,7 @@
         @Override
         public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
             evalInputs(tuple);
+            checkComparable();
             ComparisonResult r = compareResults();
             if (r == ComparisonResult.UNKNOWN) {
                 try {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
new file mode 100644
index 0000000..0d43c3d
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADayTimeDurationConstructorDescriptor.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.constructors;
+
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.ADayTimeDuration;
+import edu.uci.ics.asterix.om.base.AMutableDayTimeDuration;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class ADayTimeDurationConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
+    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new ADayTimeDurationConstructorDescriptor();
+        }
+    };
+
+    @Override
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) {
+        return new ICopyEvaluatorFactory() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private DataOutput out = output.getDataOutput();
+
+                    private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
+                    private ICopyEvaluator eval = args[0].createEvaluator(outInput);
+                    private String errorMessage = "This can not be an instance of day-time-duration";
+                    private AMutableDayTimeDuration aDayTimeDuration = new AMutableDayTimeDuration(0);
+                    @SuppressWarnings("unchecked")
+                    private ISerializerDeserializer<ADayTimeDuration> dayTimeDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADAYTIMEDURATION);
+                    @SuppressWarnings("unchecked")
+                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        try {
+                            outInput.reset();
+                            eval.evaluate(tuple);
+                            byte[] serString = outInput.getByteArray();
+
+                            if (serString[0] == SER_STRING_TYPE_TAG) {
+
+                                int stringLength = (serString[1] & 0xff << 8) + (serString[2] & 0xff << 0);
+
+                                ADurationParserFactory.parseDuration(serString, 3, stringLength, aDayTimeDuration,
+                                        ADurationParseOption.DAY_TIME);
+
+                                dayTimeDurationSerde.serialize(aDayTimeDuration, out);
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                            } else {
+                                throw new AlgebricksException(errorMessage);
+                            }
+                        } catch (Exception e1) {
+                            throw new AlgebricksException(e1);
+                        }
+                    }
+
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return AsterixBuiltinFunctions.DAY_TIME_DURATION_CONSTRUCTOR;
+    }
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
index a84ae1d..669c4f7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADurationConstructorDescriptor.java
@@ -21,6 +21,7 @@
 import edu.uci.ics.asterix.om.base.AMutableDuration;
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
@@ -82,7 +83,8 @@
 
                                 int stringLength = (serString[1] & 0xff << 8) + (serString[2] & 0xff << 0);
 
-                                ADurationParserFactory.parseDuration(serString, 3, stringLength, aDuration);
+                                ADurationParserFactory.parseDuration(serString, 3, stringLength, aDuration,
+                                        ADurationParseOption.All);
 
                                 durationSerde.serialize(aDuration, out);
                             } else if (serString[0] == SER_NULL_TYPE_TAG) {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
index 7ea8e90..f753ba6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
@@ -27,6 +27,7 @@
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.temporal.ADateParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
@@ -128,8 +129,8 @@
                                 int stringLength = (argOut1.getByteArray()[1] & 0xff << 8)
                                         + (argOut1.getByteArray()[2] & 0xff << 0);
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), 3, stringLength, aDuration);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(), 3, stringLength,
+                                        aDuration, ADurationParseOption.All);
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         aDuration.getMonths(), aDuration.getMilliseconds());
                             } else {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
index f16dccb..332158b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
@@ -29,6 +29,7 @@
 import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -141,8 +142,8 @@
                                 int stringLength = (argOut1.getByteArray()[1] & 0xff << 8)
                                         + (argOut1.getByteArray()[2] & 0xff << 0);
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), 3, stringLength, aDuration);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(), 3, stringLength,
+                                        aDuration, ADurationParseOption.All);
 
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         aDuration.getMonths(), aDuration.getMilliseconds());
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
index 35bfe17..89d1694 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
@@ -29,6 +29,7 @@
 import edu.uci.ics.asterix.om.base.temporal.ATimeParserFactory;
 import edu.uci.ics.asterix.om.base.temporal.DurationArithmeticOperations;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -138,8 +139,8 @@
                                 int stringLength = (argOut1.getByteArray()[1] & 0xff << 8)
                                         + (argOut1.getByteArray()[2] & 0xff << 0);
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), 3, stringLength, aDuration);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(), 3, stringLength,
+                                        aDuration, ADurationParseOption.All);
 
                                 if (aDuration.getMonths() != 0) {
                                     throw new AlgebricksException(FID.getName()
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
new file mode 100644
index 0000000..bc6099c
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.constructors;
+
+import java.io.DataOutput;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+import edu.uci.ics.asterix.om.base.AMutableYearMonthDuration;
+import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.AYearMonthDuration;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParserFactory.ADurationParseOption;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class AYearMonthDurationConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
+    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new AYearMonthDurationConstructorDescriptor();
+        }
+    };
+
+    @Override
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) {
+        return new ICopyEvaluatorFactory() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private DataOutput out = output.getDataOutput();
+
+                    private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
+                    private ICopyEvaluator eval = args[0].createEvaluator(outInput);
+                    private String errorMessage = "This can not be an instance of year-month-duration";
+                    private AMutableYearMonthDuration aYearMonthDuration = new AMutableYearMonthDuration(0);
+                    @SuppressWarnings("unchecked")
+                    private ISerializerDeserializer<AYearMonthDuration> yearMonthDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.AYEARMONTHDURATION);
+                    @SuppressWarnings("unchecked")
+                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        try {
+                            outInput.reset();
+                            eval.evaluate(tuple);
+                            byte[] serString = outInput.getByteArray();
+
+                            if (serString[0] == SER_STRING_TYPE_TAG) {
+
+                                int stringLength = (serString[1] & 0xff << 8) + (serString[2] & 0xff << 0);
+
+                                ADurationParserFactory.parseDuration(serString, 3, stringLength, aYearMonthDuration,
+                                        ADurationParseOption.YEAR_MONTH);
+
+                                yearMonthDurationSerde.serialize(aYearMonthDuration, out);
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                            } else {
+                                throw new AlgebricksException(errorMessage);
+                            }
+                        } catch (Exception e1) {
+                            throw new AlgebricksException(e1);
+                        }
+                    }
+
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return AsterixBuiltinFunctions.YEAR_MONTH_DURATION_CONSTRUCTOR;
+    }
+
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetDayTimeDurationDescriptor.java
similarity index 84%
copy from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
copy to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetDayTimeDurationDescriptor.java
index 97fa94a..17c6ba9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetDayTimeDurationDescriptor.java
@@ -18,8 +18,8 @@
 
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.ADayTimeDuration;
+import edu.uci.ics.asterix.om.base.AMutableDayTimeDuration;
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
@@ -38,10 +38,10 @@
 import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
-public class MillisecondsOfDayTimeDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class GetDayTimeDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
-    private final static long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MILLISECONDS_OF_DAY_TIME_DURATION;
+    private static final long serialVersionUID = 1L;
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.GET_DAY_TIME_DURATION;
 
     // allowed input types
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -51,7 +51,7 @@
 
         @Override
         public IFunctionDescriptor createFunctionDescriptor() {
-            return new MillisecondsOfDayTimeDurationDescriptor();
+            return new GetDayTimeDurationDescriptor();
         }
     };
 
@@ -74,10 +74,10 @@
                     private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.AINT64);
+                    private ISerializerDeserializer<ADayTimeDuration> dayTimeDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADAYTIMEDURATION);
 
-                    AMutableInt64 aInt64 = new AMutableInt64(0);
+                    AMutableDayTimeDuration aDayTimeDuration = new AMutableDayTimeDuration(0);
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
@@ -95,9 +95,10 @@
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            aInt64.setValue(ADurationSerializerDeserializer.getDayTime(argOut0.getByteArray(), 1));
+                            aDayTimeDuration.setMilliseconds(ADurationSerializerDeserializer.getDayTime(
+                                    argOut0.getByteArray(), 1));
 
-                            int64Serde.serialize(aInt64, out);
+                            dayTimeDurationSerde.serialize(aDayTimeDuration, out);
 
                         } catch (HyracksDataException hex) {
                             throw new AlgebricksException(hex);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetYearMonthDurationDescriptor.java
similarity index 84%
copy from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
copy to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetYearMonthDurationDescriptor.java
index 97fa94a..b7b4278 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/GetYearMonthDurationDescriptor.java
@@ -18,9 +18,9 @@
 
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
-import edu.uci.ics.asterix.om.base.AInt64;
-import edu.uci.ics.asterix.om.base.AMutableInt64;
+import edu.uci.ics.asterix.om.base.AMutableYearMonthDuration;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.AYearMonthDuration;
 import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
@@ -38,10 +38,10 @@
 import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
-public class MillisecondsOfDayTimeDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class GetYearMonthDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
-    private final static long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MILLISECONDS_OF_DAY_TIME_DURATION;
+    private static final long serialVersionUID = 1L;
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.GET_YEAR_MONTH_DURATION;
 
     // allowed input types
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
@@ -51,7 +51,7 @@
 
         @Override
         public IFunctionDescriptor createFunctionDescriptor() {
-            return new MillisecondsOfDayTimeDurationDescriptor();
+            return new GetYearMonthDurationDescriptor();
         }
     };
 
@@ -74,10 +74,10 @@
                     private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> int64Serde = AqlSerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.AINT64);
+                    private ISerializerDeserializer<AYearMonthDuration> yearMonthDurationSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.AYEARMONTHDURATION);
 
-                    AMutableInt64 aInt64 = new AMutableInt64(0);
+                    AMutableYearMonthDuration aYearMonthDuration = new AMutableYearMonthDuration(0);
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
@@ -95,9 +95,10 @@
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            aInt64.setValue(ADurationSerializerDeserializer.getDayTime(argOut0.getByteArray(), 1));
+                            aYearMonthDuration.setMonths(ADurationSerializerDeserializer.getYearMonth(
+                                    argOut0.getByteArray(), 1));
 
-                            int64Serde.serialize(aInt64, out);
+                            yearMonthDurationSerde.serialize(aYearMonthDuration, out);
 
                         } catch (HyracksDataException hex) {
                             throw new AlgebricksException(hex);
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
similarity index 88%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
index 97fa94a..14e16c6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsOfDayTimeDurationDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MillisecondsFromDayTimeDurationDescriptor.java
@@ -16,7 +16,7 @@
 
 import java.io.DataOutput;
 
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AInt64;
 import edu.uci.ics.asterix.om.base.AMutableInt64;
@@ -38,20 +38,20 @@
 import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
-public class MillisecondsOfDayTimeDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class MillisecondsFromDayTimeDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private final static long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MILLISECONDS_OF_DAY_TIME_DURATION;
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MILLISECONDS_FROM_DAY_TIME_DURATION;
 
     // allowed input types
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private final static byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
 
     public final static IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
         public IFunctionDescriptor createFunctionDescriptor() {
-            return new MillisecondsOfDayTimeDurationDescriptor();
+            return new MillisecondsFromDayTimeDurationDescriptor();
         }
     };
 
@@ -90,12 +90,12 @@
                                 return;
                             }
 
-                            if (argOut0.getByteArray()[0] != SER_DURATION_TYPE_TAG) {
-                                throw new AlgebricksException(FID.getName() + ": expects NULL/DURATION, but got "
+                            if (argOut0.getByteArray()[0] != SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                throw new AlgebricksException(FID.getName() + ": expects NULL/DAY-TIME-DURATION, but got "
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            aInt64.setValue(ADurationSerializerDeserializer.getDayTime(argOut0.getByteArray(), 1));
+                            aInt64.setValue(ADayTimeDurationSerializerDeserializer.getDayTime(argOut0.getByteArray(), 1));
 
                             int64Serde.serialize(aInt64, out);
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsOfYearMonthDurationDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsFromYearMonthDurationDescriptor.java
similarity index 87%
rename from asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsOfYearMonthDurationDescriptor.java
rename to asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsFromYearMonthDurationDescriptor.java
index 55173a5..9a66d45 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsOfYearMonthDurationDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/temporal/MonthsFromYearMonthDurationDescriptor.java
@@ -16,7 +16,7 @@
 
 import java.io.DataOutput;
 
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AYearMonthDurationerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AInt32;
 import edu.uci.ics.asterix.om.base.AMutableInt32;
@@ -38,20 +38,20 @@
 import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
-public class MonthsOfYearMonthDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
+public class MonthsFromYearMonthDurationDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private final static long serialVersionUID = 1L;
-    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MONTHS_OF_YEAR_MONTH_DURATION;
+    public final static FunctionIdentifier FID = AsterixBuiltinFunctions.MONTHS_FROM_YEAR_MONTH_DURATION;
 
     // allowed input types
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private final static byte SER_YEARMONTHDURATION_TYPE_TAG = ATypeTag.YEARMONTHDURATION.serialize();
 
     public final static IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
         public IFunctionDescriptor createFunctionDescriptor() {
-            return new MonthsOfYearMonthDurationDescriptor();
+            return new MonthsFromYearMonthDurationDescriptor();
         }
     };
 
@@ -90,12 +90,14 @@
                                 return;
                             }
 
-                            if (argOut0.getByteArray()[0] != SER_DURATION_TYPE_TAG) {
-                                throw new AlgebricksException(FID.getName() + ": expects NULL/DURATION, but got "
+                            if (argOut0.getByteArray()[0] != SER_YEARMONTHDURATION_TYPE_TAG) {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/YEAR-MONTH-DURATION, but got "
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            aInt32.setValue(ADurationSerializerDeserializer.getYearMonth(argOut0.getByteArray(), 1));
+                            aInt32.setValue(AYearMonthDurationerializerDeserializer.getYearMonth(
+                                    argOut0.getByteArray(), 1));
 
                             int32Serde.serialize(aInt32, out);
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
index 8bc792c..2c81b7c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
@@ -90,6 +90,7 @@
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ACircleConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ADateConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ADateTimeConstructorDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.constructors.ADayTimeDurationConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ADoubleConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ADurationConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.AFloatConstructorDescriptor;
@@ -111,6 +112,7 @@
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ARectangleConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.AStringConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.constructors.ATimeConstructorDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.constructors.AYearMonthDurationConstructorDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.AndDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.AnyCollectionMemberDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.CastListDescriptor;
@@ -210,6 +212,8 @@
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DurationEqualDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DurationFromMillisecondsDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DurationFromMonthsDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.GetDayTimeDurationDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.GetYearMonthDurationDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalAfterDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalBeforeDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalCoveredByDescriptor;
@@ -218,12 +222,15 @@
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalEndsDecriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMeetsDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMetByDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MillisecondsFromDayTimeDurationDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MonthsFromYearMonthDurationDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.OverlapDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlappedByDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlapsDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartedByDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartsDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MillisecondsOfDayTimeDurationDescriptor;
-import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MonthsOfYearMonthDurationDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MillisecondsFromDayTimeDurationDescriptor;
+import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.MonthsFromYearMonthDurationDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.OverlapDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDateDescriptor;
 import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDatetimeDescriptor;
@@ -419,6 +426,8 @@
         temp.add(ADateConstructorDescriptor.FACTORY);
         temp.add(ADateTimeConstructorDescriptor.FACTORY);
         temp.add(ADurationConstructorDescriptor.FACTORY);
+        temp.add(AYearMonthDurationConstructorDescriptor.FACTORY);
+        temp.add(ADayTimeDurationConstructorDescriptor.FACTORY);
 
         // Spatial
         temp.add(CreatePointDescriptor.FACTORY);
@@ -519,9 +528,11 @@
         temp.add(YearMonthDurationComparatorDecriptor.LESS_THAN_FACTORY);
         temp.add(DayTimeDurationComparatorDescriptor.GREATER_THAN_FACTORY);
         temp.add(DayTimeDurationComparatorDescriptor.LESS_THAN_FACTORY);
-        temp.add(MonthsOfYearMonthDurationDescriptor.FACTORY);
-        temp.add(MillisecondsOfDayTimeDurationDescriptor.FACTORY);
+        temp.add(MonthsFromYearMonthDurationDescriptor.FACTORY);
+        temp.add(MillisecondsFromDayTimeDurationDescriptor.FACTORY);
         temp.add(DurationEqualDescriptor.FACTORY);
+        temp.add(GetYearMonthDurationDescriptor.FACTORY);
+        temp.add(GetDayTimeDurationDescriptor.FACTORY);
 
         // Interval constructor
         temp.add(AIntervalFromDateConstructorDescriptor.FACTORY);
diff --git a/asterix-test-framework/.gitignore b/asterix-test-framework/.gitignore
new file mode 100644
index 0000000..ea8c4bf
--- /dev/null
+++ b/asterix-test-framework/.gitignore
@@ -0,0 +1 @@
+/target