Merged asterix_stabilization r551:r564.

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_fix_issue_154@565 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/data/events/tiny/event.adm b/asterix-app/data/events/tiny/event.adm
index 21fd7e7..5e9d4b3 100644
--- a/asterix-app/data/events/tiny/event.adm
+++ b/asterix-app/data/events/tiny/event.adm
@@ -5,8 +5,8 @@
     "sponsoring_sigs": [ { "sig_id": 14, "chapter_name": "San Clemente" }, 
                          { "sig_id": 14, "chapter_name": "Laguna Beach" } ],
     "interest_keywords": {{ "art", "landscape", "nature", "vernissage" }},
-    "start_time": datetime( "2011-02-23T18:00:00:000-08:00" ),
-    "end_time": datetime( "2011-02-23T21:00:00:000-08:00" ) 
+    "start_time": datetime( "2011-02-23T18:00:00.000-08:00" ),
+    "end_time": datetime( "2011-02-23T21:00:00.000-08:00" ) 
   }
   { 
     "event_id": 941, 
@@ -16,8 +16,8 @@
     "sponsoring_sigs": [ { "sig_id": 31, "chapter_name": "Huntington Beach" } ],
     "interest_keywords": {{ "scuba", "diving", "aquatics" }},
     "price": 40.00,
-    "start_time": datetime( "2010-10-16T09:00:00:000-08:00" ),
-    "end_time": datetime( "2010-10-16T12:00:00:000-08:00" )
+    "start_time": datetime( "2010-10-16T09:00:00.000-08:00" ),
+    "end_time": datetime( "2010-10-16T12:00:00.000-08:00" )
   }
   { 
     "event_id": 1042, 
@@ -26,7 +26,7 @@
     "sponsoring_sigs": [ { "sig_id": 14, "chapter_name": "Laguna Beach" } ],
     "interest_keywords": {{ "architecture", "photography" }},
     "price": 10.00,
-    "start_time": datetime( "2011-02-23T17:00:00:000-08:00" ),
-    "end_time": datetime( "2011-02-23T19:00:00:000-08:00" ) 
+    "start_time": datetime( "2011-02-23T17:00:00.000-08:00" ),
+    "end_time": datetime( "2011-02-23T19:00:00.000-08:00" ) 
   } 
   
\ No newline at end of file
diff --git a/asterix-app/data/nontagged/allData.json b/asterix-app/data/nontagged/allData.json
index e70257a..5f7bf3b 100644
--- a/asterix-app/data/nontagged/allData.json
+++ b/asterix-app/data/nontagged/allData.json
@@ -1,2 +1,2 @@
-{ "id": 10, "name": string("Nancy"), "age": 32.5f, "salary": 12.000 ,"married": boolean("true"), "interests": {{"reading", "writing"}}, "children": ["Brad", "Scott"],  "address": {  "number": 8389,  "street": "Hill St.",  "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30Z"), "datetime": datetime("-1951-12-27T12:20:30"),  "duration": duration("D10Y11M12DT10H50M30S"),  "location2d": point("41.00,44.00"),  "location3d": point3d("44.00,13.00,41.00"), "line" : line("10.1,11.1 10.2,11.2"), "polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle" : circle("10.1,11.1 10.2") }
+{ "id": 10, "name": string("Nancy"), "age": 32.5f, "salary": 12.000 ,"married": boolean("true"), "interests": {{"reading", "writing"}}, "children": ["Brad", "Scott"],  "address": {  "number": 8389,  "street": "Hill St.",  "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30Z"), "datetime": datetime("-1951-12-27T12:20:30"),  "duration": duration("P10Y11M12DT10H50M30S"),  "location2d": point("41.00,44.00"),  "location3d": point3d("44.00,13.00,41.00"), "line" : line("10.1,11.1 10.2,11.2"), "polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle" : circle("10.1,11.1 10.2") }
 
diff --git a/asterix-app/data/nontagged/tempData.json b/asterix-app/data/nontagged/tempData.json
index 1fef3ab..a40a254 100644
--- a/asterix-app/data/nontagged/tempData.json
+++ b/asterix-app/data/nontagged/tempData.json
@@ -1,2 +1,2 @@
-{ "id": 10, "date": date("2011-01-27"), "time": time("12:20:30"), "datetime": datetime("1951-12-27T12:20:30"),  "duration": duration("D30Y10M15DT10H30M50S"), "date2": date("2011-01-27-05:00"), "time2": time("12:20:30:999-05:00"), "datetime2": datetime("1951-12-27T12:20:30:250-08:45"),  "duration2": duration("D10M15DT10H50S"), "date3": date("-2011-01-27-05:00"), "time3": time("12:20:30:999Z"), "datetime3": datetime("-1951-12-27T12:20:30:250-08:15"),  "duration3": duration("-DT50S"), "date4": date("-2011-01-27Z"), "time4": time("12:20:30Z"), "datetime4": datetime("-1951-12-27T12:20:30:250Z"), "duration4": duration("-D10M"), "date5": date("2011-01-27"), "time5": time("12:20:30"), "datetime5": datetime("1951-12-27T12:20:30"),  "duration5": duration("D30Y10M15DT10H30M50S") }
+{ "id": 10, "date": date("2011-01-27"), "time": time("12:20:30"), "datetime": datetime("1951-12-27T12:20:30"),  "duration": duration("P30Y10M15DT10H30M50S"), "date2": date("2011-01-27"), "time2": time("12:20:30.999-05:00"), "datetime2": datetime("1951-12-27T12:20:30.250-08:45"),  "duration2": duration("P10M15DT10H50S"), "date3": date("-2011-01-27"), "time3": time("12:20:30.999Z"), "datetime3": datetime("-1951-12-27T12:20:30.250-08:15"),  "duration3": duration("-PT50S"), "date4": date("-2011-01-27"), "time4": time("12:20:30Z"), "datetime4": datetime("-1951-12-27T12:20:30.250Z"), "duration4": duration("-P10M"), "date5": date("2011-01-27"), "time5": time("12:20:30"), "datetime5": datetime("1951-12-27T12:20:30"),  "duration5": duration("P30Y10M15DT10H30M50S") }
 
diff --git a/asterix-app/data/nontagged/tempData.txt b/asterix-app/data/nontagged/tempData.txt
index 6615812..0afeb6f 100644
--- a/asterix-app/data/nontagged/tempData.txt
+++ b/asterix-app/data/nontagged/tempData.txt
@@ -1,4 +1,4 @@
-10|date("2011-01-27")|time("12:20:30")|datetime("1951-12-27T12:20:30")|duration("D30Y10M15DT10H30M50S")
-20|date("2011-01-27-05:00")|time("12:20:30:999-05:00")|datetime("1951-12-27T12:20:30:250-08:45")|duration("D10M15DT10H50S")
-30|date("-2011-01-27-05:00")|time("12:20:30:999Z")|datetime("-1951-12-27T12:20:30:250-08:15")|duration("-DT50S")
-40|date("-2011-01-27Z")|time("12:20:30Z")|datetime("-1951-12-27T12:20:30:250Z")|duration("-D10M")
+10|date("2011-01-27")|time("12:20:30")|datetime("1951-12-27T12:20:30")|duration("P30Y10M15DT10H30M50S")
+20|date("2011-01-27")|time("12:20:30.999-05:00")|datetime("1951-12-27T12:20:30.250-08:45")|duration("P10M15DT10H50S")
+30|date("-2011-01-27")|time("12:20:30.999Z")|datetime("-1951-12-27T12:20:30.250-08:15")|duration("-PT50S")
+40|date("-2011-01-27")|time("12:20:30Z")|datetime("-1951-12-27T12:20:30.250Z")|duration("-P10M")
diff --git a/asterix-app/src/test/resources/aqljts/results/nested_01.adm b/asterix-app/src/test/resources/aqljts/results/nested_01.adm
index 54444c7..27de5c0 100644
--- a/asterix-app/src/test/resources/aqljts/results/nested_01.adm
+++ b/asterix-app/src/test/resources/aqljts/results/nested_01.adm
@@ -30,4 +30,4 @@
 ARecordType: 
 field: t
 AbstractCollectionType: 
-ADateTime: { 2011-9-16:11:0:0:0:0:0 }
+ADateTime: { 2011-09-16T11:00:00.000Z }
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_order.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_order.aql
index 2e151ab..f2d8208 100644
--- a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_order.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_order.aql
@@ -11,7 +11,13 @@
 let $dt3 := datetime("2005-01-01T00:00:00+04:00")
 let $dt4 := datetime("2011-12-31T13:00:00-11:00")
 let $dt5 := datetime("2012-04-06T00:00:00Z")
+let $dt6 := datetime("-1937-07-07T23:00:00+08:00")
+let $dt7 := datetime("-1600-03-01T00:00:00.384+06:00")
+let $dt8 := datetime("-1600-02-29T23:59:59.999Z")
+let $dt9 := datetime("2000-02-29T23:59:59.999Z")
+let $dt10 := datetime("2000-03-01T01:59:59.999+07:00")
+let $dt11 := datetime("-1600-03-01T00:00:00.384-06:00")
 
-for $dt in [$dt1, $dt2, $dt3, $dt4, $dt5]
+for $dt in [$dt1, $dt2, $dt3, $dt4, $dt5, $dt6, $dt7, $dt8, $dt9, $dt10, $dt11]
 order by $dt
 return $dt
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_tzeq.aql b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_tzeq.aql
index e38bdae..1a0bb52 100644
--- a/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_tzeq.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/comparison/datetime_tzeq.aql
@@ -8,6 +8,10 @@
 
 let $dt1 := datetime("2011-12-31T14:00:00-10:00")
 let $dt2 := datetime("2012-01-01T00:00:00Z")
+let $dt3 := datetime("2000-03-01T02:00:00+04:00")
+let $dt4 := datetime("2000-02-29T22:00:00Z")
+let $r1 := $dt1 = $dt2
+let $r2 := $dt3 = $dt4
 
 
-return [$dt1 = $dt2]
\ No newline at end of file
+return { "result1": $r1,"result2": $r2 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/date_01.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/date_01.aql
index c889627..9bbfb9d 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/date_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/date_01.aql
@@ -4,12 +4,14 @@
 
 write output to nc1:"rttest/constructor_date_01.adm";
 
-let $c1 := date("2010-10-30+05:00")
-let $c2 := date("2010-10-30-10:15")
-let $c3 := date("1987-11-19")
-let $c4 := date("1987-11-19Z")
-let $c5 := date("-1987-11-19+08:30")
-let $c6 := date("0001-12-27")
-let $c7 := date("-1951-01-27-01:45")
-return {"date1": $c1, "date2": $c2, "date3": $c3, "date4": $c4, "date5": $c5, "date6": $c6, "date7": $c7}
+let $c1 := date("2010-10-30")
+let $c2 := date("1987-11-19")
+let $c3 := date("-1987-11-19")
+let $c4 := date("0001-12-27")
+let $c5 := date("-1951-12-27")
+let $c6 := date("-2043-11-19")
+let $c7 := date("-19280329")
+let $c8 := date("19280329")
+
+return {"date1": $c1, "date2": $c2, "date3": $c3, "date4": $c4, "date5": $c5, "date6": $c6, "date7": $c7, "date8": $c8}
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01.aql
index 611feff..c4163d8 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/datetime_01.aql
@@ -1,13 +1,22 @@
+drop dataverse test if exists;
+create dataverse test;
 use dataverse test;
 
 write output to nc1:"rttest/constructor_datetime_01.adm";
 
-let $c1 := datetime("2010-10-30T10:50:56:999+05:45")
-let $c2 := datetime("2010-10-30T10:30:56:250-10:00")
-let $c3 := datetime("1987-11-19T09:20:00:200")
+let $c1 := datetime("2010-10-30T10:50:56.999+05:45")
+let $c2 := datetime("2010-10-30T10:30:56.250-10:00")
+let $c3 := datetime("1987-11-19T09:20:00.200Z")
 let $c4 := datetime("1987-11-19T10:50:56Z")
-let $c5 := datetime("-1987-11-19T10:50:56:099-05:30")
-let $c6 := datetime("-0001-11-19T10:50:56:719Z")
-let $c7 := datetime("1951-12-27T12:20:15")
-return {"datetime1": $c1, "datetime2": $c2, "datetime3": $c3, "datetime4": $c4, "datetime5": $c5, "datetime6": $c6, "datetime7": $c7}
+let $c5 := datetime("-1987-11-19T10:50:56.099-05:30")
+let $c6 := datetime("-0001-11-19T10:50:56.719Z")
+let $c7 := datetime("1951-12-27T12:20:15Z")
+let $c8 := datetime("2043-11-19T10:50:56.719Z")
+let $c9 := datetime("-19280329T174937374-0630")
+let $c10 := datetime("-19280329T174937374+0630")
+let $c11 := datetime("-19280329T174937374")
+let $c12 := datetime("-19280329T174937374+0630")
+let $c13 := datetime("-19280329T17493737+0630")
+let $c14 := datetime("-19280301T05493737+0630")
+return {"datetime1": $c1, "datetime2": $c2, "datetime3": $c3, "datetime4": $c4, "datetime5": $c5, "datetime6": $c6, "datetime7": $c7, "datetime8": $c8, "datetime9": $c9, "datetime10": $c10, "datetime11": $c11, "datetime12": $c12, "datetime13": $c13, "datetime14": $c14}
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01.aql
index 011996c..59a3634 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/duration_01.aql
@@ -4,13 +4,17 @@
 
 write output to nc1:"rttest/constructor_duration_01.adm";
 
-let $c1 := duration("D30Y10M25DT13H12M50S")
-let $c2 := duration("D25DT13H12M50S")
-let $c3 := duration("DT13H12M50S")
-let $c4 := duration("D30YT12MS")
-let $c5 := duration("DT13H")
-let $c6 := duration("-D30Y10M25DT13H12M50S")
-let $c7 := duration("-D25DT13H12M50S")
-let $c8 := duration("-DT13H50S")
-return {"duration1": $c1, "duration2": $c2, "duration3": $c3, "duration4": $c4, "duration5": $c5, "duration6": $c6, "duration7": $c7, "duration8": $c8}
+let $c1 := duration("P30Y10M25DT13H12M50S")
+let $c2 := duration("P25DT13H12M50S")
+let $c3 := duration("PT13H12M50S")
+let $c4 := duration("P30YT12MS")
+let $c5 := duration("PT13H")
+let $c6 := duration("-P30Y10M25DT13H12M50S")
+let $c7 := duration("-P25DT13H12M50S")
+let $c8 := duration("-PT13H50S")
+let $c9 := duration("P120D")
+let $c10 := duration("-P28M")
+let $c11 := duration("PT29M90.937S")
+let $c12 := duration("P300Y15M60DT300H98M482.435S")
+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/constructor/time_01.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/time_01.aql
index caa90f0..4a040a1 100644
--- a/asterix-app/src/test/resources/runtimets/queries/constructor/time_01.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/time_01.aql
@@ -4,12 +4,16 @@
 
 write output to nc1:"rttest/constructor_time_01.adm";
 
-let $c1 := time("10:50:56:200+05:00")
-let $c2 := time("10:50:56:200-10:15")
+let $c1 := time("10:50:56.200+05:00")
+let $c2 := time("10:50:56.200-10:15")
 let $c3 := time("10:50:56")
-let $c4 := time("10:50:56:200Z")
-let $c5 := time("23:59:59:999-13:30")
-let $c6 := time("24:00:00:000+14:45")
-let $c7 := time("12:59:00:019-01:00")
-return {"time1": $c1, "time2": $c2, "time3": $c3, "time4": $c4, "time5": $c5, "time6": $c6, "time7": $c7}
+let $c4 := time("10:50:56.200Z")
+let $c5 := time("23:59:59.999-13:30")
+let $c6 := time("00:00:00.000+14:45")
+let $c7 := time("12:59:00.019-01:00")
+let $c8 := time("12:59:00.01-01:00")
+let $c9 := time("12:59:00.019-01:00")
+let $c10 := time("12590001-0100")
+let $c11 := time("125900019-0100")
+return {"time1": $c1, "time2": $c2, "time3": $c3, "time4": $c4, "time5": $c5, "time6": $c6, "time7": $c7, "time8": $c8, "time9": $c9, "time10": $c10, "time11": $c11}
 
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql
new file mode 100644
index 0000000..c3dc7ba
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/insert-src-dst-01.aql
@@ -0,0 +1,40 @@
+/*
+ * Description     : Insert from source dataset into target dataset
+ * Expected Result : Success
+ * Date            : 25th July 2012
+ * Issue #         : Issue 76
+ */
+
+drop dataverse testdv2 if exists;
+create dataverse testdv2;
+use dataverse testdv2;
+
+write output to nc1:"rttest/dml_insert-src-dst-01.adm";
+
+create type testtype01 as closed {
+  id: string,
+  name: string?
+}
+
+create type testtype02 as closed {
+  id: string
+}
+
+create dataset testds01(testtype01) partitioned by key id;
+create dataset testds02(testtype02) partitioned by key id;
+
+insert into dataset testds01 ({ "id": "001" });
+insert into dataset testds01 ({ "id": "002", "name": "John Doe" });
+
+insert into dataset testds02 ({ "id": "003" });
+insert into dataset testds02 ({ "id": "004" });
+insert into dataset testds02 ({ "id": "005" });
+
+insert into dataset testds01(
+for $d in dataset("testds02")
+return $d
+);
+
+for $d in dataset("testds01")
+order by $d.id
+return $d
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql
new file mode 100644
index 0000000..9e05da3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for17.aql
@@ -0,0 +1,11 @@
+/*
+ * Description     : Test union of two lists
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+(for $a in [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
+return $a)
+union
+(for $b in [{"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}]
+return $b)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql
new file mode 100644
index 0000000..2f1b7ce
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let28.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     : Test let clause and floating point literals
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+let $a := [137.8932f,156f,.98781f, 436.219F,.89217F,16789F]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql
new file mode 100644
index 0000000..55d6319
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let29.aql
@@ -0,0 +1,8 @@
+/*
+ * Description     : Test let clause and double literals
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+let $a := [137.8932,.98781,436.219,.89217,-234.324]
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql
new file mode 100644
index 0000000..eebc11f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let30.aql
@@ -0,0 +1,12 @@
+/*
+ * Description     : Test union of two lists, bind each list to a variable
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+// $a and $b are ordered lists with one Record each.
+
+let $a := [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
+let $b := [{"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}]
+let $c := $a union $b
+return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql
new file mode 100644
index 0000000..84ac278
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let31.aql
@@ -0,0 +1,12 @@
+/*
+ * Description     : Test union of two lists, bind each list to a variable
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+// $a and $b hold one Record each.
+
+let $a := {"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}
+let $b := {"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}
+let $c := $a union $b
+return $c
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql
new file mode 100644
index 0000000..0881fde
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/let32.aql
@@ -0,0 +1,11 @@
+/*
+ * Description     : Test union of two lists, bind each list to a variable
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+let $m := (for $a in [{"id":1234,"name":"John Doe","age":56,"salary":50000,"dept":"HR"}]
+return $a)
+let $n := (for $b in [{"id":3424,"name":"Roger Sanders","age":46,"salary":60000,"dept":"Publishing"}]
+return $b)
+return $m union $n
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql
new file mode 100644
index 0000000..a5aec23
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-01.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $a in ["two","four","six","eight","ten","twenty","undo"]
+order by $a desc
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql
new file mode 100644
index 0000000..4cc087c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-02.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $a in ["two","four","six","eight","ten","twenty","undo"]
+order by $a asc
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql
new file mode 100644
index 0000000..3792c74
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-03.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$b,"test"]) asc
+return string-concat([$b,"test"])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql
new file mode 100644
index 0000000..e7a209b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-04.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$b,"test"]) desc
+return string-concat([$b,"test"])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql
new file mode 100644
index 0000000..c3139f5
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-05.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$b,""]) desc
+return string-concat([$b,""])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql
new file mode 100644
index 0000000..791af3a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-06.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$b,""]) asc
+return string-concat([$b,""])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql
new file mode 100644
index 0000000..9c85780
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-07.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat(["",$b]) desc
+return string-concat(["",$b])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql
new file mode 100644
index 0000000..6a823c8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-08.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $b in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat(["",$b]) asc
+return string-concat(["",$b])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql
new file mode 100644
index 0000000..0df3a9e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-09.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$x,$x]) asc 
+return string-concat([$x,$x])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql
new file mode 100644
index 0000000..09a9026
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-10.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+order by string-concat([$x,$x]) desc 
+return string-concat([$x,$x])
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql
new file mode 100644
index 0000000..5b79987
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-11.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $x in [1,3,4,5,2,3,33,55,43,12,34,45,67,66,89,0,-1,999]
+order by ($x+$x) asc
+return ($x+$x)
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql
new file mode 100644
index 0000000..b620a05
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/order-by-12.aql
@@ -0,0 +1,9 @@
+/*
+ * Description     : Test order by clause of FLWOR
+ * Expected Result : Success
+ * Date            : 24th July 2012
+ */
+
+for $x in [[1,3,4],[5,2],[3,33,55],[43,12,34],[45,67],[66,89,0],[-1,999]]
+order by len($x)
+return { "x":$x,"len($x)":len($x) }
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql
new file mode 100644
index 0000000..0c7e73e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/ret-01.aql
@@ -0,0 +1,8 @@
+/*
+ * Description      :  Test return clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+for $x in ["ten","twenty","thirty","forty","fifty","sixty","seventy","ninety"]
+return string-length($x)
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/datetime_order.adm b/asterix-app/src/test/resources/runtimets/results/comparison/datetime_order.adm
index 14f3ab1..21f8208 100644
--- a/asterix-app/src/test/resources/runtimets/results/comparison/datetime_order.adm
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/datetime_order.adm
@@ -1,5 +1,11 @@
-datetime("2005-01-01T00:00:00:000+04:00")
-datetime("2012-01-01T00:00:00:000+00:00")
-datetime("2011-12-31T14:00:00:000-10:00")
-datetime("2011-12-31T13:00:00:000-11:00")
-datetime("2012-04-06T00:00:00:000+00:00")
+datetime("-1937-07-07T15:00:00.000Z")
+datetime("-1600-02-29T18:00:00.384Z")
+datetime("-1600-02-29T23:59:59.999Z")
+datetime("-1600-03-01T06:00:00.384Z")
+datetime("2000-02-29T18:59:59.999Z")
+datetime("2000-02-29T23:59:59.999Z")
+datetime("2004-12-31T20:00:00.000Z")
+datetime("2012-01-01T00:00:00.000Z")
+datetime("2012-01-01T00:00:00.000Z")
+datetime("2012-01-01T00:00:00.000Z")
+datetime("2012-04-06T00:00:00.000Z")
diff --git a/asterix-app/src/test/resources/runtimets/results/comparison/datetime_tzeq.adm b/asterix-app/src/test/resources/runtimets/results/comparison/datetime_tzeq.adm
index 5dc225e..167bafb 100644
--- a/asterix-app/src/test/resources/runtimets/results/comparison/datetime_tzeq.adm
+++ b/asterix-app/src/test/resources/runtimets/results/comparison/datetime_tzeq.adm
@@ -1 +1 @@
-[ true ]
+{ "result1": true, "result2": true }
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/date_01.adm b/asterix-app/src/test/resources/runtimets/results/constructor/date_01.adm
index b0cb1e4..2a90c4d 100644
--- a/asterix-app/src/test/resources/runtimets/results/constructor/date_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/date_01.adm
@@ -1 +1 @@
-{ "date1": date("2010-10-30+05:00"), "date2": date("2010-10-30-10:15"), "date3": date("1987-11-19+00:00"), "date4": date("1987-11-19+00:00"), "date5": date("-1987-11-19+08:30"), "date6": date("0001-12-27+00:00"), "date7": date("-1951-01-27-01:45") }
\ No newline at end of file
+{ "date1": date("2010-10-30"), "date2": date("1987-11-19"), "date3": date("-1987-11-19"), "date4": date("0001-12-27"), "date5": date("-1951-12-27"), "date6": date("-2043-11-19"), "date7": date("-1928-03-29"), "date8": date("1928-03-29") }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/datetime_01.adm b/asterix-app/src/test/resources/runtimets/results/constructor/datetime_01.adm
index 30d2cdb..54e76c4 100644
--- a/asterix-app/src/test/resources/runtimets/results/constructor/datetime_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/datetime_01.adm
@@ -1 +1 @@
-{ "datetime1": datetime("2010-10-30T10:50:56:980+05:45"), "datetime2": datetime("2010-10-30T10:30:56:240-10:00"), "datetime3": datetime("1987-11-19T09:20:00:200+00:00"), "datetime4": datetime("1987-11-19T10:50:56:000+00:00"), "datetime5": datetime("-1987-11-19T10:50:56:080-05:30"), "datetime6": datetime("-0001-11-19T10:50:56:700+00:00"), "datetime7": datetime("1951-12-27T12:20:15:000+00:00") }
+{ "datetime1": datetime("2010-10-30T05:05:56.999Z"), "datetime2": datetime("2010-10-30T20:30:56.250Z"), "datetime3": datetime("1987-11-19T09:20:00.200Z"), "datetime4": datetime("1987-11-19T10:50:56.000Z"), "datetime5": datetime("-1987-11-19T16:20:56.099Z"), "datetime6": datetime("-0001-11-19T10:50:56.719Z"), "datetime7": datetime("1951-12-27T12:20:15.000Z"), "datetime8": datetime("2043-11-19T10:50:56.719Z"), "datetime9": datetime("-1928-03-30T00:19:37.374Z"), "datetime10": datetime("-1928-03-29T11:19:37.374Z"), "datetime11": datetime("-1928-03-29T17:49:37.374Z"), "datetime12": datetime("-1928-03-29T11:19:37.374Z"), "datetime13": datetime("-1928-03-29T11:19:37.370Z"), "datetime14": datetime("-1928-02-29T23:19:37.370Z") }
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/duration_01.adm b/asterix-app/src/test/resources/runtimets/results/constructor/duration_01.adm
index b80ed1a..3a9cbb7 100644
--- a/asterix-app/src/test/resources/runtimets/results/constructor/duration_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/duration_01.adm
@@ -1 +1 @@
-{ "duration1": duration("D30Y10M25DT13H12M50S"), "duration2": duration("D0Y0M25DT13H12M50S"), "duration3": duration("D0Y0M0DT13H12M50S"), "duration4": duration("D30Y0M0DT0H12M0S"), "duration5": duration("D0Y0M0DT13H0M0S"), "duration6": duration("-D30Y10M25DT13H12M50S"), "duration7": duration("-D0Y0M25DT13H12M50S"), "duration8": duration("-D0Y0M0DT13H0M50S") }
+{ "duration1": duration("P30Y10M25DT13H12M50S"), "duration2": duration("P25DT13H12M50S"), "duration3": duration("PT13H12M50S"), "duration4": duration("P30YT12M"), "duration5": duration("PT13H"), "duration6": duration("-P30Y10M25DT13H12M50S"), "duration7": duration("-P25DT13H12M50S"), "duration8": duration("-PT13H50S"), "duration9": duration("P120D"), "duration10": duration("-P2Y4M"), "duration11": duration("PT30M30.937S"), "duration12": duration("P301Y3M72DT13H46M2.435S") }
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/time_01.adm b/asterix-app/src/test/resources/runtimets/results/constructor/time_01.adm
index 2c932b5..ef6adc9 100644
--- a/asterix-app/src/test/resources/runtimets/results/constructor/time_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/time_01.adm
@@ -1 +1 @@
-{ "time1": time("10:50:56:200+05:00"), "time2": time("10:50:56:200-10:15"), "time3": time("10:50:56:000+00:00"), "time4": time("10:50:56:200+00:00"), "time5": time("23:59:59:980-13:30"), "time6": time("24:00:00:000+14:45"), "time7": time("12:59:00:000-01:00") }
+{ "time1": time("05:50:56.200Z"), "time2": time("21:05:56.200Z"), "time3": time("10:50:56.000Z"), "time4": time("10:50:56.200Z"), "time5": time("13:29:59.999Z"), "time6": time("09:15:00.000Z"), "time7": time("13:59:00.019Z"), "time8": time("13:59:00.010Z"), "time9": time("13:59:00.019Z"), "time10": time("13:59:00.010Z"), "time11": time("13:59:00.019Z") }
diff --git a/asterix-app/src/test/resources/runtimets/results/dml/insert-src-dst-01.adm b/asterix-app/src/test/resources/runtimets/results/dml/insert-src-dst-01.adm
new file mode 100644
index 0000000..70b6b95
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/dml/insert-src-dst-01.adm
@@ -0,0 +1,5 @@
+{ "id": "001", "name": null }
+{ "id": "002", "name": "John Doe" }
+{ "id": "003", "name": null }
+{ "id": "004", "name": null }
+{ "id": "005", "name": null }
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01.adm b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01.adm
index 3fad2e3..64aee7c 100644
--- a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01.adm
@@ -1 +1 @@
-{ "id": 10, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27+00:00"), "time": time("12:20:30:000+00:00"), "datetime": datetime("-1951-12-27T12:20:30:000+00:00"), "duration": duration("D10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2") }
+{ "id": 10, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2") }
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/temp_types_01.adm b/asterix-app/src/test/resources/runtimets/results/scan/temp_types_01.adm
index 013a0cb..4ad4f1c 100644
--- a/asterix-app/src/test/resources/runtimets/results/scan/temp_types_01.adm
+++ b/asterix-app/src/test/resources/runtimets/results/scan/temp_types_01.adm
@@ -1 +1 @@
-{ "id": 10, "date": date("2011-01-27+00:00"), "time": time("12:20:30:000+00:00"), "datetime": datetime("1951-12-27T12:20:30:000+00:00"), "duration": duration("D30Y10M15DT10H30M50S"), "date2": date("2011-01-27-05:00"), "time2": time("12:20:30:980-05:00"), "datetime2": datetime("1951-12-27T12:20:30:240-08:45"), "duration2": duration("D0Y10M15DT10H0M50S"), "date3": date("-2011-01-27-05:00"), "time3": time("12:20:30:980+00:00"), "datetime3": datetime("-1951-12-27T12:20:30:240-08:15"), "duration3": duration("-D0Y0M0DT0H0M50S"), "date4": date("-2011-01-27+00:00"), "time4": time("12:20:30:000+00:00"), "datetime4": datetime("-1951-12-27T12:20:30:240+00:00"), "duration4": duration("-D0Y10M0DT0H0M0S"), "date5": date("2011-01-27+00:00"), "time5": time("12:20:30:000+00:00"), "datetime5": datetime("1951-12-27T12:20:30:000+00:00"), "duration5": duration("D30Y10M15DT10H30M50S") }
\ No newline at end of file
+{ "id": 10, "date": date("2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("1951-12-27T12:20:30.000Z"), "duration": duration("P30Y10M15DT10H30M50S"), "date2": date("2011-01-27"), "time2": time("17:20:30.999Z"), "datetime2": datetime("1951-12-27T21:05:30.250Z"), "duration2": duration("P10M15DT10H50S"), "date3": date("-2011-01-27"), "time3": time("12:20:30.999Z"), "datetime3": datetime("-1951-12-27T20:35:30.250Z"), "duration3": duration("-PT50S"), "date4": date("-2011-01-27"), "time4": time("12:20:30.000Z"), "datetime4": datetime("-1951-12-27T12:20:30.250Z"), "duration4": duration("-P10M"), "date5": date("2011-01-27"), "time5": time("12:20:30.000Z"), "datetime5": datetime("1951-12-27T12:20:30.000Z"), "duration5": duration("P30Y10M15DT10H30M50S") }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/temp_types_02.adm b/asterix-app/src/test/resources/runtimets/results/scan/temp_types_02.adm
index f87b1e5..f0b6815 100644
--- a/asterix-app/src/test/resources/runtimets/results/scan/temp_types_02.adm
+++ b/asterix-app/src/test/resources/runtimets/results/scan/temp_types_02.adm
@@ -1,4 +1,4 @@
-{ "id": 10, "date": date("2011-01-27+00:00"), "time": time("12:20:30:000+00:00"), "datetime": datetime("1951-12-27T12:20:30:000+00:00"), "duration": duration("D30Y10M15DT10H30M50S") }
-{ "id": 20, "date": date("2011-01-27-05:00"), "time": time("12:20:30:980-05:00"), "datetime": datetime("1951-12-27T12:20:30:240-08:45"), "duration": duration("D0Y10M15DT10H0M50S") }
-{ "id": 30, "date": date("-2011-01-27-05:00"), "time": time("12:20:30:980+00:00"), "datetime": datetime("-1951-12-27T12:20:30:240-08:15"), "duration": duration("-D0Y0M0DT0H0M50S") }
-{ "id": 40, "date": date("-2011-01-27+00:00"), "time": time("12:20:30:000+00:00"), "datetime": datetime("-1951-12-27T12:20:30:240+00:00"), "duration": duration("-D0Y10M0DT0H0M0S") }
+{ "id": 10, "date": date("2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("1951-12-27T12:20:30.000+00:00"), "duration": duration("P30Y10M15DT10H30M50S") }
+{ "id": 20, "date": date("2011-01-27"), "time": time("17:20:30.999Z"), "datetime": datetime("1951-12-27T12:20:30.240-08:45"), "duration": duration("P10M15DT10H50S") }
+{ "id": 30, "date": date("-2011-01-27"), "time": time("12:20:30.999Z"), "datetime": datetime("-1951-12-27T12:20:30.240-08:15"), "duration": duration("-PT50S") }
+{ "id": 40, "date": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.240+00:00"), "duration": duration("-P10M") }
diff --git a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java
index 325eff4..86a5301 100644
--- a/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java
+++ b/asterix-external-data/src/main/java/edu/uci/ics/asterix/external/data/parser/ManagedDelimitedDataTupleParser.java
@@ -33,9 +33,9 @@
 import edu.uci.ics.hyracks.api.comm.IFrameWriter;
 import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
index 76895ca..08121ca 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/ExternalDatasetDetails.java
@@ -33,7 +33,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class ExternalDatasetDetails implements IDatasetDetails {
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
index 9761c47..d9f1f38 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/FeedDatasetDetails.java
@@ -32,7 +32,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class FeedDatasetDetails extends InternalDatasetDetails {
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
index 53d10e4..61616c5 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entities/InternalDatasetDetails.java
@@ -32,7 +32,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class InternalDatasetDetails implements IDatasetDetails {
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/AbstractTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/AbstractTupleTranslator.java
index 7e85909..377efc7 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/AbstractTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/AbstractTupleTranslator.java
@@ -24,9 +24,9 @@
 import edu.uci.ics.asterix.om.base.AString;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleReference;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 
 /**
  * Contains common members shared across all concrete implementations of
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
index 2eda4a8..fbec4b1 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatasetTupleTranslator.java
@@ -46,7 +46,7 @@
 import edu.uci.ics.asterix.om.base.IACursor;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
 import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
index c939ee6..b39a1bf 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/DatatypeTupleTranslator.java
@@ -53,7 +53,7 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
 import edu.uci.ics.hyracks.storage.am.btree.exceptions.BTreeDuplicateKeyException;
 
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
index 15d880c..cdf43fb 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/FunctionTupleTranslator.java
@@ -34,7 +34,7 @@
 import edu.uci.ics.asterix.om.base.IACursor;
 import edu.uci.ics.asterix.om.types.AOrderedListType;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
 
 /**
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
index 3c8c48a..7f723cb 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/IndexTupleTranslator.java
@@ -39,7 +39,7 @@
 import edu.uci.ics.asterix.om.types.AOrderedListType;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
 
 /**
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
index 2efec8e..8c7645b 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/entitytupletranslators/NodeGroupTupleTranslator.java
@@ -35,7 +35,7 @@
 import edu.uci.ics.asterix.om.base.IACursor;
 import edu.uci.ics.asterix.om.types.AUnorderedListType;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
 
 /**
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADateTimeAscBinaryComparatorFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADateTimeAscBinaryComparatorFactory.java
index b62c21a..2dd8785 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADateTimeAscBinaryComparatorFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/comparators/ADateTimeAscBinaryComparatorFactory.java
@@ -1,6 +1,5 @@
 package edu.uci.ics.asterix.dataflow.data.nontagged.comparators;
 
-import edu.uci.ics.asterix.om.base.AMutableDateTime;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
 
@@ -15,41 +14,27 @@
     @Override
     public IBinaryComparator createBinaryComparator() {
         return new IBinaryComparator() {
-        	
-            private AMutableDateTime dt1 = new AMutableDateTime(0, 0, 0, 0, 0, 0, 0, 0, 0);
-            private AMutableDateTime dt2 = new AMutableDateTime(0, 0, 0, 0, 0, 0, 0, 0, 0);
 
             @Override
             public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
-                short year = (short) (((b1[s1] & 0xff) << 8) | b1[s1 + 1] & 0xff);
-                int time = ((b1[s1 + 4] & 0xff) << 24) | ((b1[s1 + 5] & 0xff) << 16) | ((b1[s1 + 6] & 0xff) << 8)
-                        | (b1[s1 + 7] & 0xff);
 
-                dt1.setValue(year >> 1, // year
-                        (year & 0x0001) * 8 + ((b1[s1 + 2] >>> 5) & 0x07), // month
-                        b1[s1 + 2] & 0x1f, // day
-                        (short) ((time) * 20 % 216000000 / 3600000), // hour
-                        (short) ((time) * 20 % 3600000 / 60000), // minutes
-                        (short) ((time) * 20 % 60000 / 1000), // seconds
-                        (short) ((time) * 20 % 1000), // milliseconds
-                        0, // microseconds
-                        b1[s1 + 3]); // timezone
+                long chrononTime1 = getLong(b1, s1);
+                long chrononTime2 = getLong(b2, s2);
 
-                year = (short) (((b2[s2] & 0xff) << 8) | b2[s2 + 1] & 0xff);
-                time = ((b2[s2 + 4] & 0xff) << 24) | ((b2[s2 + 5] & 0xff) << 16) | ((b2[s2 + 6] & 0xff) << 8)
-                        | (b2[s2 + 7] & 0xff);
+                if (chrononTime1 > chrononTime2) {
+                    return 1;
+                } else if (chrononTime1 < chrononTime2) {
+                    return -1;
+                } else {
+                    return 0;
+                }
+            }
 
-                dt2.setValue(year >> 1, // year
-                        (year & 0x0001) * 8 + ((b2[s2 + 2] >>> 5) & 0x07), // month
-                        b2[s2 + 2] & 0x1f, // day
-                        (short) ((time) * 20 % 216000000 / 3600000), // hour
-                        (short) ((time) * 20 % 3600000 / 60000), // minutes
-                        (short) ((time) * 20 % 60000 / 1000), // seconds
-                        (short) ((time) * 20 % 1000), // milliseconds
-                        0, // microseconds
-                        b2[s2 + 3]); // timezone
-
-                return dt1.compare(dt2);
+            private long getLong(byte[] bytes, int start) {
+                return (((long) (bytes[start] & 0xff)) << 56) + (((long) (bytes[start + 1] & 0xff)) << 48)
+                        + (((long) (bytes[start + 2] & 0xff)) << 40) + (((long) (bytes[start + 3] & 0xff)) << 32)
+                        + (((long) (bytes[start + 4] & 0xff)) << 24) + (((long) (bytes[start + 5] & 0xff)) << 16)
+                        + (((long) (bytes[start + 6] & 0xff)) << 8) + (((long) (bytes[start + 7] & 0xff)) << 0);
             }
 
         };
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
index e9f887e..24aa144 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADatePrinter.java
@@ -2,15 +2,18 @@
 
 import java.io.PrintStream;
 
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+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;
 
 public class ADatePrinter implements IPrinter {
 
     private static final long serialVersionUID = 1L;
+    private static long CHRONON_OF_DAY = 24 * 60 * 60 * 1000;
     public static final ADatePrinter INSTANCE = new ADatePrinter();
-
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+    
     @Override
     public void init() {
 
@@ -18,11 +21,14 @@
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        int year = AInt16SerializerDeserializer.getShort(b, s + 1) >> 1;
-        int month = (AInt16SerializerDeserializer.getShort(b, s + 1) & 0x0001) * 8 + ((b[s + 3] >> 5) & 0x07);
-        int day = b[s + 3] & 0x1f;
-        byte timezone = b[s + 4];
-        ps.format("date(\"" + (year < 0 ? "%+05d" : "%04d") + "-%02d-%02d%+03d:%02d\")", year, month, day,
-                timezone / 4, timezone % 4 * ((timezone >= 0) ? 15 : -15));
+        long chrononTime = AInt32SerializerDeserializer.getInt(b, s + 1) * CHRONON_OF_DAY;
+
+        int year = gCalInstance.getYear(chrononTime);
+        int month = gCalInstance.getMonthOfYear(chrononTime, year);
+
+        ps.print("date(\"");
+        ps.append(String.format(year < 0 ? "%05d" : "%04d", year)).append("-").append(String.format("%02d", month))
+                .append("-").append(String.format("%02d", gCalInstance.getDayOfMonthYear(chrononTime, year, month)));
+        ps.print("\")");
     }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
index e3999f1..d856a20 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADateTimePrinter.java
@@ -1,18 +1,17 @@
 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.AInt16SerializerDeserializer;
-import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+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 ADateTimePrinter implements IPrinter {
 
     private static final long serialVersionUID = 1L;
     public static final ADateTimePrinter INSTANCE = new ADateTimePrinter();
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
 
     @Override
     public void init() {
@@ -21,49 +20,18 @@
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        int year = AInt16SerializerDeserializer.getShort(b, s + 1) >> 1;
-        int month = (AInt16SerializerDeserializer.getShort(b, s + 1) & 0x0001) * 8 + ((b[s + 3] >> 5) & 0x07);
+        long chrononTime = AInt64SerializerDeserializer.getLong(b, s + 1);
 
-        int day = b[s + 3] & 0x1f;
-        byte timezone = b[s + 4];
-
-        int time = AInt32SerializerDeserializer.getInt(b, s + 5);
-        // int msec = (time) * 20 % 1000;
-        // int sec = (time) * 20 % 60000 / 1000;
-        // int min = (time) * 20 % 3600000 / 60000;
-        // int hour = (time) * 20 % 216000000 / 3600000;
+        int year = gCalInstance.getYear(chrononTime);
+        int month = gCalInstance.getMonthOfYear(chrononTime, year);
 
         ps.print("datetime(\"");
-        if (year < 0) {
-            ps.print("-");
-        }
-        int y = Math.abs(year);
-        if (y < 1000) {
-            ps.print("0");
-        }
-        if (y < 100) {
-            ps.print("0");
-        }
-        if (y < 10) {
-            ps.print("0");
-        }
-        try {
-            WriteValueTools.writeInt(y, ps);
-            ps.print("-");
-            if (month < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(month, ps);
-            ps.print("-");
-            if (day < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(day, ps);
-            ps.print("T");
-        } catch (IOException e) {
-            throw new AlgebricksException(e);
-        }
-        ATimePrinter.printTime(time, timezone, ps);
+        ps.append(String.format(year < 0 ? "%05d" : "%04d", year)).append("-").append(String.format("%02d", month))
+                .append("-").append(String.format("%02d", gCalInstance.getDayOfMonthYear(chrononTime, year, month)))
+                .append("T").append(String.format("%02d", gCalInstance.getHourOfDay(chrononTime))).append(":")
+                .append(String.format("%02d", gCalInstance.getMinOfHour(chrononTime))).append(":")
+                .append(String.format("%02d", gCalInstance.getSecOfMin(chrononTime))).append(".")
+                .append(String.format("%03d", gCalInstance.getMillisOfSec(chrononTime))).append("Z");
         ps.print("\")");
     }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADurationPrinter.java
index 1c4e302..a59b9ac 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADurationPrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ADurationPrinter.java
@@ -4,6 +4,8 @@
 import java.io.PrintStream;
 
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+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;
@@ -12,6 +14,7 @@
 
     private static final long serialVersionUID = 1L;
     public static final ADurationPrinter INSTANCE = new ADurationPrinter();
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
 
     @Override
     public void init() {
@@ -22,39 +25,63 @@
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
         boolean positive = true;
         int months = AInt32SerializerDeserializer.getInt(b, s + 1);
-        int seconds = AInt32SerializerDeserializer.getInt(b, s + 5);
+        long milliseconds = AInt64SerializerDeserializer.getLong(b, s + 5);
 
-        if (months < 0 || seconds < 0) {
+        // set the negative flag. "||" is necessary in case that months field is not there (so it is 0)
+        if (months < 0 || milliseconds < 0) {
             months *= -1;
-            seconds *= -1;
+            milliseconds *= -1;
             positive = false;
         }
 
-        int month = (int) (months % 12);
-        int year = (int) (months / 12);
-        int second = (int) (seconds % 60);
-        int minute = (int) (seconds % 3600 / 60);
-        int hour = (int) (seconds % (86400) / 3600);
-        int day = (int) (seconds / (86400));
+        int month = gCalInstance.getDurationMonth(months);
+        int year = gCalInstance.getDurationYear(months);
+        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("duration(\"");
         if (!positive) {
             ps.print("-");
         }
         try {
-            ps.print("D");
-            WriteValueTools.writeInt(year, ps);
-            ps.print("Y");
-            WriteValueTools.writeInt(month, ps);
-            ps.print("M");
-            WriteValueTools.writeInt(day, ps);
-            ps.print("DT");
-            WriteValueTools.writeInt(hour, ps);
-            ps.print("H");
-            WriteValueTools.writeInt(minute, ps);
-            ps.print("M");
-            WriteValueTools.writeInt(second, ps);
-            ps.print("S\")");
+            ps.print("P");
+            if (year != 0) {
+                WriteValueTools.writeInt(year, ps);
+                ps.print("Y");
+            }
+            if (month != 0) {
+                WriteValueTools.writeInt(month, ps);
+                ps.print("M");
+            }
+            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/AInt16Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
index 1434d80..8961013 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt16Printer.java
@@ -9,7 +9,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 public class AInt16Printer implements IPrinter {
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
index 48d8236..318828e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt64Printer.java
@@ -9,7 +9,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 public class AInt64Printer implements IPrinter {
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
index 99c8d7f..bd4139d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/AInt8Printer.java
@@ -9,7 +9,7 @@
 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;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 public class AInt8Printer implements IPrinter {
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
index 7f687ea..72a6e37 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinter.java
@@ -1,18 +1,18 @@
 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 ATimePrinter implements IPrinter {
 
     private static final long serialVersionUID = 1L;
     public static final ATimePrinter INSTANCE = new ATimePrinter();
-
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+    
     @Override
     public void init() {
 
@@ -21,55 +21,14 @@
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
         int time = AInt32SerializerDeserializer.getInt(b, s + 1);
+        
         ps.print("time(\"");
-        int timezone = time >> 24;
-        time -= (timezone << 24);
-        printTime(time, timezone, ps);
+        ps.append(String.format("%02d", gCalInstance.getHourOfDay(time))).append(":")
+                .append(String.format("%02d", gCalInstance.getMinOfHour(time))).append(":")
+                .append(String.format("%02d", gCalInstance.getSecOfMin(time))).append(".")
+                .append(String.format("%03d", gCalInstance.getMillisOfSec(time))).append("Z");
+
         ps.print("\")");
     }
 
-    final static void printTime(int time, int timezone, PrintStream ps) throws AlgebricksException {
-        int msec = time * 20 % 1000;
-        int sec = time * 20 % 60000 / 1000;
-        int min = time * 20 % 3600000 / 60000;
-        int hour = time * 20 % 216000000 / 3600000;
-        try {
-            if (hour < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(hour, ps);
-            ps.print(":");
-            if (min < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(min, ps);
-            ps.print(":");
-            if (sec < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(sec, ps);
-            ps.print(":");
-            if (msec < 100) {
-                ps.print("0");
-            }
-            if (msec < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(msec, ps);
-            ps.print(timezone >= 0 ? "+" : "-");
-            int t1 = Math.abs(timezone / 4);
-            if (t1 < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(t1, ps);
-            ps.print(":");
-            int t2 = timezone % 4 * ((timezone >= 0) ? 15 : -15);
-            if (t2 < 10) {
-                ps.print("0");
-            }
-            WriteValueTools.writeInt(t2, ps);
-        } catch (IOException e) {
-            throw new AlgebricksException(e);
-        }
-    }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinterFactory.java
index 2603067..afafb89 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinterFactory.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ATimePrinterFactory.java
@@ -3,8 +3,6 @@
 import edu.uci.ics.hyracks.algebricks.data.IPrinter;
 import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
 
-
-
 public class ATimePrinterFactory implements IPrinterFactory {
 
     private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ABooleanSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ABooleanSerializerDeserializer.java
index 474ed85..de95bba 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ABooleanSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ABooleanSerializerDeserializer.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ACircleSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ACircleSerializerDeserializer.java
index bbf9fbb..02bb281 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ACircleSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ACircleSerializerDeserializer.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateSerializerDeserializer.java
index 6a0e8cd..9bd25f4 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateSerializerDeserializer.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -7,6 +21,9 @@
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.ADate;
 import edu.uci.ics.asterix.om.base.AMutableDate;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
+import edu.uci.ics.asterix.om.base.temporal.StringCharSequenceAccessor;
 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;
@@ -14,15 +31,11 @@
 public class ADateSerializerDeserializer implements ISerializerDeserializer<ADate> {
 
     private static final long serialVersionUID = 1L;
-    private short year;
-    private byte monthAndDay;
 
     public static final ADateSerializerDeserializer INSTANCE = new ADateSerializerDeserializer();
     @SuppressWarnings("unchecked")
-    private static ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
+    private static final ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
             .getSerializerDeserializer(BuiltinType.ADATE);
-    private static AMutableDate aDate = new AMutableDate(0, 0, 0, 0);
-    private static String errorMessage = " can not be an instance of date";
 
     private ADateSerializerDeserializer() {
     }
@@ -30,10 +43,7 @@
     @Override
     public ADate deserialize(DataInput in) throws HyracksDataException {
         try {
-            year = in.readShort();
-            monthAndDay = in.readByte();
-            return new ADate(year >> 1, (year & 0x0001) * 8 + ((monthAndDay >> 5) & 0x07), monthAndDay & 0x1f,
-                    in.readByte());
+            return new ADate(in.readInt());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
@@ -42,60 +52,30 @@
     @Override
     public void serialize(ADate instance, DataOutput out) throws HyracksDataException {
         try {
-            out.writeByte((byte) ((instance.getYear() << 1) >> 8));
-            out.writeByte((byte) ((byte) ((instance.getYear() << 1) & 0x00ff) + (byte) (instance.getMonth() >> 3)));
-            out.writeByte((byte) (((byte) (instance.getMonth() << 5)) | ((byte) instance.getDay())));
-            out.writeByte((byte) instance.getTimeZone());
+            out.writeInt(instance.getChrononTimeInDays());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
     }
 
     public static void parse(String date, DataOutput out) throws HyracksDataException {
-        int offset = 0;
-        boolean positive = true;
-        byte timezonePart = 0;
-        if (date.charAt(0) == '-') {
-            positive = false;
-            offset++;
+        AMutableDate aDate = new AMutableDate(0);
+
+        long chrononTimeInMs = 0;
+        try {
+            StringCharSequenceAccessor charAccessor = new StringCharSequenceAccessor();
+            charAccessor.reset(date, 0);
+            chrononTimeInMs = ADateAndTimeParser.parseDatePart(charAccessor, true);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
         }
 
-        if (date.charAt(offset + 4) != '-' || date.charAt(offset + 7) != '-')
-            throw new HyracksDataException(date + errorMessage);
-        short year = Short.parseShort(date.substring(offset, offset + 4));
-        short month = Short.parseShort(date.substring(offset + 5, offset + 7));
-        short day = Short.parseShort(date.substring(offset + 8, offset + 10));
-        short hour, minute;
-        if (year < 0 || year > 9999 || month < 0 || month > 12 || day < 0 || day > 31)
-            throw new HyracksDataException(date + errorMessage);
-
-        offset += 10;
-
-        if (date.length() > offset) {
-            if (date.charAt(offset) == 'Z')
-                timezonePart = 0;
-            else {
-                if ((date.charAt(offset) != '+' && date.charAt(offset) != '-') || (date.charAt(offset + 3) != ':'))
-                    throw new HyracksDataException(date + errorMessage);
-
-                hour = Short.parseShort(date.substring(offset + 1, offset + 3));
-                minute = Short.parseShort(date.substring(offset + 4, offset + 6));
-
-                if (hour < 0 || hour > 24 || (hour == 24 && minute != 0)
-                        || (minute != 0 && minute != 15 && minute != 30 && minute != 45))
-                    throw new HyracksDataException(date + errorMessage);
-
-                if (date.charAt(offset) == '-')
-                    timezonePart = (byte) -((hour * 4) + minute / 15);
-                else
-                    timezonePart = (byte) ((hour * 4) + minute / 15);
-            }
-
+        short temp = 0;
+        if (chrononTimeInMs < 0 && chrononTimeInMs % GregorianCalendarSystem.CHRONON_OF_DAY != 0) {
+            temp = 1;
         }
-        if (!positive)
-            year *= -1;
-        aDate.setValue(year, month, day, timezonePart);
+        aDate.setValue((int) (chrononTimeInMs / GregorianCalendarSystem.CHRONON_OF_DAY) - temp);
+
         dateSerde.serialize(aDate, out);
     }
-
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
index c22da77..cb9e8e0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADateTimeSerializerDeserializer.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -7,7 +21,10 @@
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.ADateTime;
 import edu.uci.ics.asterix.om.base.AMutableDateTime;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
+import edu.uci.ics.asterix.om.base.temporal.StringCharSequenceAccessor;
 import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
 
@@ -17,15 +34,10 @@
 
     public static final ADateTimeSerializerDeserializer INSTANCE = new ADateTimeSerializerDeserializer();
     @SuppressWarnings("unchecked")
-    private static ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
+    private static final ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
             .getSerializerDeserializer(BuiltinType.ADATETIME);
-    private static AMutableDateTime aDateTime = new AMutableDateTime(0, 0, 0, 0, 0, 0, 0, 0, 0);
-    private static String errorMessage = " can not be an instance of datetime";
 
-    private int time;
-    private byte timezone;
-    private short year;
-    private byte monthAndDay;
+    private static final String errorMessage = "This can not be an instance of datetime";
 
     private ADateTimeSerializerDeserializer() {
     }
@@ -33,14 +45,7 @@
     @Override
     public ADateTime deserialize(DataInput in) throws HyracksDataException {
         try {
-            year = in.readShort();
-            monthAndDay = in.readByte();
-            timezone = in.readByte();
-            time = in.readInt();
-
-            return new ADateTime(year >> 1, (year & 0x0001) * 8 + ((monthAndDay >> 5) & 0x07), monthAndDay & 0x1f,
-                    (short) ((time) * 20 % 216000000 / 3600000), (short) ((time) * 20 % 3600000 / 60000),
-                    (short) ((time) * 20 % 60000 / 1000), (short) ((time) * 20 % 1000), (short) 0, timezone);
+            return new ADateTime(in.readLong());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
@@ -49,92 +54,40 @@
     @Override
     public void serialize(ADateTime instance, DataOutput out) throws HyracksDataException {
         try {
-            out.writeByte((byte) ((instance.getYear() << 1) >> 8));
-            out.writeByte((byte) ((byte) ((instance.getYear() << 1) & 0x00ff) + (byte) (instance.getMonth() >> 3)));
-            out.writeByte((byte) ((instance.getMonth() << 5) | (instance.getDay())));
-            out.writeByte((byte) instance.getTimeZone());
-            out.writeInt((((((instance.getHours() * 60) + instance.getMinutes()) * 60) + instance.getSeconds()) * 1000 + instance
-                    .getMilliseconds()) / 20);
+            out.writeLong(instance.getChrononTime());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
     }
 
     public static void parse(String datetime, DataOutput out) throws HyracksDataException {
-        boolean positive = true;
-        int offset = 0;
-        byte timezonePart = 0;
+        AMutableDateTime aDateTime = new AMutableDateTime(0L);
 
-        if (datetime.charAt(offset) == '-') {
-            offset++;
-            positive = false;
-        }
+        long chrononTimeInMs = 0;
+        try {
+            StringCharSequenceAccessor charAccessor = new StringCharSequenceAccessor();
+            charAccessor.reset(datetime, 0);
 
-        if (datetime.charAt(offset + 4) != '-' || datetime.charAt(offset + 7) != '-')
-            throw new HyracksDataException(datetime + errorMessage);
+            // +1 if it is negative (-)
+            short timeOffset = (short) ((charAccessor.getCharAt(0) == '-') ? 1 : 0);
 
-        short year = Short.parseShort(datetime.substring(offset, offset + 4));
-        short month = Short.parseShort(datetime.substring(offset + 5, offset + 7));
-        short day = Short.parseShort(datetime.substring(offset + 8, offset + 10));
-
-        if (year < 0 || year > 9999 || month < 0 || month > 12 || day < 0 || day > 31)
-            throw new HyracksDataException(datetime + errorMessage);
-
-        if (!positive)
-            year *= -1;
-
-        if (datetime.charAt(offset + 10) != 'T')
-            throw new HyracksDataException(datetime + errorMessage);
-
-        offset += 11;
-
-        if (datetime.charAt(offset + 2) != ':' || datetime.charAt(offset + 5) != ':')
-            throw new HyracksDataException(datetime + errorMessage);
-
-        short hour = Short.parseShort(datetime.substring(offset, offset + 2));
-        short minute = Short.parseShort(datetime.substring(offset + 3, offset + 5));
-        short second = Short.parseShort(datetime.substring(offset + 6, offset + 8));
-        short msecond = 0;
-
-        if (datetime.length() > offset + 8 && datetime.charAt(offset + 8) == ':') {
-            msecond = Short.parseShort(datetime.substring(offset + 9, offset + 12));
-            if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || msecond < 0
-                    || msecond > 999 || (hour == 24 && (minute != 0 || second != 0 || msecond != 0)))
-                throw new HyracksDataException(datetime + errorMessage);
-            offset += 12;
-        } else {
-            if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                    || (hour == 24 && (minute != 0 || second != 0)))
-                throw new HyracksDataException(datetime + errorMessage);
-            offset += 8;
-        }
-
-        short timezoneHour = 0, timezoneMinute = 0;
-        if (datetime.length() > offset) {
-            if (datetime.charAt(offset) == 'Z')
-                timezonePart = 0;
-            else {
-                if ((datetime.charAt(offset) != '+' && datetime.charAt(offset) != '-')
-                        || (datetime.charAt(offset + 3) != ':'))
-                    throw new HyracksDataException(datetime + errorMessage);
-
-                timezoneHour = Short.parseShort(datetime.substring(offset + 1, offset + 3));
-                timezoneMinute = Short.parseShort(datetime.substring(offset + 4, offset + 6));
-
-                if (timezoneHour < 0
-                        || timezoneHour > 24
-                        || (timezoneHour == 24 && timezoneMinute != 0)
-                        || (timezoneMinute != 0 && timezoneMinute != 15 && timezoneMinute != 30 && timezoneMinute != 45))
-                    throw new HyracksDataException(datetime + errorMessage);
-
-                if (datetime.charAt(offset) == '-')
-                    timezonePart = (byte) -((timezoneHour * 4) + timezoneMinute / 15);
-                else
-                    timezonePart = (byte) ((timezoneHour * 4) + timezoneMinute / 15);
+            if (charAccessor.getCharAt(timeOffset + 10) != 'T' && charAccessor.getCharAt(timeOffset + 8) != 'T') {
+                throw new AlgebricksException(errorMessage + ": missing T");
             }
 
+            // if extended form 11, else 9
+            timeOffset += (charAccessor.getCharAt(timeOffset + 13) == ':') ? (short) (11) : (short) (9);
+
+            chrononTimeInMs = ADateAndTimeParser.parseDatePart(charAccessor, false);
+
+            charAccessor.reset(datetime, timeOffset);
+
+            chrononTimeInMs += ADateAndTimeParser.parseTimePart(charAccessor);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
         }
-        aDateTime.setValue(year, month, day, hour, minute, second, msecond, 0, timezonePart);
+        aDateTime.setValue(chrononTimeInMs);
+
         datetimeSerde.serialize(aDateTime, out);
     }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADoubleSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADoubleSerializerDeserializer.java
index 0fdd657..115b2ec 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADoubleSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ADoubleSerializerDeserializer.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
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 134eed6..c3333f0 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
@@ -7,6 +7,8 @@
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.ADuration;
 import edu.uci.ics.asterix.om.base.AMutableDuration;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParser;
+import edu.uci.ics.asterix.om.base.temporal.StringCharSequenceAccessor;
 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;
@@ -16,12 +18,9 @@
     private static final long serialVersionUID = 1L;
 
     public static final ADurationSerializerDeserializer INSTANCE = new ADurationSerializerDeserializer();
-
-    private static AMutableDuration aDuration = new AMutableDuration(0, 0);
     @SuppressWarnings("unchecked")
-    private static ISerializerDeserializer<ADuration> durationSerde = AqlSerializerDeserializerProvider.INSTANCE
+    private static final ISerializerDeserializer<ADuration> durationSerde = AqlSerializerDeserializerProvider.INSTANCE
             .getSerializerDeserializer(BuiltinType.ADURATION);
-    private static String errorMessage = " can not be an instance of duration";
 
     private ADurationSerializerDeserializer() {
     }
@@ -29,7 +28,7 @@
     @Override
     public ADuration deserialize(DataInput in) throws HyracksDataException {
         try {
-            return new ADuration(in.readInt(), in.readInt());
+            return new ADuration(in.readInt(), in.readLong());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
@@ -39,7 +38,7 @@
     public void serialize(ADuration instance, DataOutput out) throws HyracksDataException {
         try {
             out.writeInt(instance.getMonths());
-            out.writeInt(instance.getSeconds());
+            out.writeLong(instance.getMilliseconds());
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
@@ -47,119 +46,14 @@
 
     public static void parse(String duration, DataOutput out) throws HyracksDataException {
         try {
-            boolean positive = true;
-            int offset = 0;
-            int value = 0, hour = 0, minute = 0, second = 0, year = 0, month = 0, day = 0;
-            boolean isYear = true, isMonth = true, isDay = true, isHour = true, isMinute = true, isSecond = true;
-            boolean isTime = false;
-            boolean timeItem = true;
-            if (duration.charAt(offset) == '-') {
-                offset++;
-                positive = false;
-            }
+            AMutableDuration aDuration = new AMutableDuration(0, 0);
+            StringCharSequenceAccessor charAccessor = new StringCharSequenceAccessor();
+            charAccessor.reset(duration, 0);
+            ADurationParser.parse(charAccessor, aDuration);
 
-            if (duration.charAt(offset++) != 'D')
-                throw new HyracksDataException(duration + errorMessage);
-
-            for (; offset < duration.length(); offset++) {
-                if (duration.charAt(offset) >= '0' && duration.charAt(offset) <= '9')
-                    value = value * 10 + duration.charAt(offset) - '0';
-                else {
-                    switch (duration.charAt(offset)) {
-                        case 'Y':
-                            if (isYear) {
-                                year = value;
-                                isYear = false;
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-                        case 'M':
-                            if (!isTime) {
-                                if (isMonth) {
-                                    if (value < 0 || value > 11)
-                                        throw new HyracksDataException(duration + errorMessage);
-                                    else {
-                                        month = value;
-                                        isMonth = false;
-                                    }
-                                } else
-                                    throw new HyracksDataException(duration + errorMessage);
-                            } else if (isMinute) {
-                                if (value < 0 || value > 59)
-                                    throw new HyracksDataException(duration + errorMessage);
-                                else {
-                                    minute = value;
-                                    isMinute = false;
-                                    timeItem = false;
-                                }
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-                        case 'D':
-                            if (isDay) {
-                                if (value < 0 || value > 30)
-                                    throw new HyracksDataException(duration + errorMessage);
-                                else {
-                                    day = value;
-                                    isDay = false;
-                                }
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-                        case 'T':
-                            if (!isTime) {
-                                isTime = true;
-                                timeItem = true;
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-
-                        case 'H':
-                            if (isHour) {
-                                if (value < 0 || value > 23)
-                                    throw new HyracksDataException(duration + errorMessage);
-                                else {
-                                    hour = value;
-                                    isHour = false;
-                                    timeItem = false;
-                                }
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-                        case 'S':
-                            if (isSecond) {
-                                if (value < 0 || value > 59)
-                                    throw new HyracksDataException(duration + errorMessage);
-                                else {
-                                    second = value;
-                                    isSecond = false;
-                                    timeItem = false;
-                                }
-                            } else
-                                throw new HyracksDataException(duration + errorMessage);
-                            break;
-                        default:
-                            throw new HyracksDataException(duration + errorMessage);
-
-                    }
-                    value = 0;
-                }
-            }
-
-            if (isTime && timeItem)
-                throw new HyracksDataException(duration + errorMessage);
-
-            if (isYear && isMonth && isDay && !isTime)
-                throw new HyracksDataException(duration + errorMessage);
-
-            if (positive)
-                aDuration.setValue(year * 12 + month, day * 24 * 3600 + 3600 * hour + 60 * minute + second);
-            else
-                aDuration.setValue(-1 * (year * 12 + month), -1
-                        * (day * 24 * 3600 + 3600 * hour + 60 * minute + second));
             durationSerde.serialize(aDuration, out);
-        } catch (HyracksDataException e) {
-            throw new HyracksDataException(duration + errorMessage);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
         }
     }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
index 7299b7c..c68f82a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
@@ -18,7 +18,7 @@
 import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class AOrderedListSerializerDeserializer implements ISerializerDeserializer<AOrderedList> {
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARecordSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARecordSerializerDeserializer.java
index 3b87368..393f634 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARecordSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ARecordSerializerDeserializer.java
@@ -38,7 +38,7 @@
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class ARecordSerializerDeserializer implements ISerializerDeserializer<ARecord> {
     private static final long serialVersionUID = 1L;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
index 1d4fe07..8860f2a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/ATimeSerializerDeserializer.java
@@ -7,6 +7,8 @@
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AMutableTime;
 import edu.uci.ics.asterix.om.base.ATime;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
+import edu.uci.ics.asterix.om.base.temporal.StringCharSequenceAccessor;
 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;
@@ -18,12 +20,8 @@
     public static final ATimeSerializerDeserializer INSTANCE = new ATimeSerializerDeserializer();
 
     @SuppressWarnings("unchecked")
-    private static ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
+    private static final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
             .getSerializerDeserializer(BuiltinType.ATIME);
-    private static AMutableTime aTime = new AMutableTime(0, 0, 0, 0, 0, 0);
-    private static String errorMessage = " can not be an instance of time";
-
-    private int time, timezone;
 
     private ATimeSerializerDeserializer() {
     }
@@ -31,12 +29,8 @@
     @Override
     public ATime deserialize(DataInput in) throws HyracksDataException {
         try {
-            time = in.readInt();
-            timezone = time >> 24;
-            time -= (timezone << 24);
-            return new ATime((short) ((time << 8 >> 8) * 20 % 216000000 / 3600000),
-                    (short) ((time << 8 >> 8) * 20 % 3600000 / 60000), (short) ((time << 8 >> 8) * 20 % 60000 / 1000),
-                    (short) ((time << 8 >> 8) * 20 % 1000), (short) 0, timezone);
+            return new ATime(in.readInt());
+
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
@@ -45,84 +39,28 @@
     @Override
     public void serialize(ATime instance, DataOutput out) throws HyracksDataException {
         try {
-            time = instance.getTimeZone();
-            time = time << 24;
-            time = time
-                    + ((((((instance.getHours() * 60) + instance.getMinutes()) * 60) + instance.getSeconds()) * 1000 + instance
-                            .getMilliseconds()) / 20);
-            out.writeInt(time);
+            out.writeInt(instance.getChrononTime());
 
         } catch (IOException e) {
             throw new HyracksDataException(e);
         }
     }
 
-    public static final void serialize(short hour, short minute, short second, short msecond, byte timeZone,
-            DataOutput out) throws HyracksDataException {
-        try {
-            int time = timeZone;
-            time = time << 24;
-            time = time + ((((((hour * 60) + minute) * 60) + second) * 1000 + msecond) / 20);
-            out.writeInt(time);
-        } catch (IOException e) {
-            throw new HyracksDataException(e);
-        }
-    }
-
     public static void parse(String time, DataOutput out) throws HyracksDataException {
+        AMutableTime aTime = new AMutableTime(0);
+        int chrononTimeInMs;
+
         try {
-            byte timezonePart = 0;
-            int offset = 0;
-            if (time.charAt(offset + 2) != ':' || time.charAt(offset + 5) != ':')
-                throw new HyracksDataException(time + errorMessage);
-
-            short hour = Short.parseShort(time.substring(offset, offset + 2));
-            short minute = Short.parseShort(time.substring(offset + 3, offset + 5));
-            short second = Short.parseShort(time.substring(offset + 6, offset + 8));
-            short msecond = 0;
-            if (time.length() > offset + 8 && time.charAt(offset + 8) == ':') {
-                msecond = Short.parseShort(time.substring(offset + 9, offset + 12));
-                if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59 || msecond < 0
-                        || msecond > 999 || (hour == 24 && (minute != 0 || second != 0 || msecond != 0)))
-                    throw new HyracksDataException(time + errorMessage);
-                offset += 12;
-            } else {
-                if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                        || (hour == 24 && (minute != 0 || second != 0)))
-                    throw new HyracksDataException(time + errorMessage);
-                offset += 8;
-            }
-
-            short timezoneHour = 0, timezoneMinute = 0;
-            if (time.length() > offset) {
-                if (time.charAt(offset) == 'Z')
-                    timezonePart = 0;
-                else {
-                    if ((time.charAt(offset) != '+' && time.charAt(offset) != '-') || (time.charAt(offset + 3) != ':'))
-                        throw new HyracksDataException(time + errorMessage);
-
-                    timezoneHour = Short.parseShort(time.substring(offset + 1, offset + 3));
-                    timezoneMinute = Short.parseShort(time.substring(offset + 4, offset + 6));
-
-                    if (timezoneHour < 0
-                            || timezoneHour > 24
-                            || (timezoneHour == 24 && timezoneMinute != 0)
-                            || (timezoneMinute != 0 && timezoneMinute != 15 && timezoneMinute != 30 && timezoneMinute != 45))
-                        throw new HyracksDataException(time + errorMessage);
-
-                    if (time.charAt(offset) == '-')
-                        timezonePart = (byte) -((timezoneHour * 4) + timezoneMinute / 15);
-                    else
-                        timezonePart = (byte) ((timezoneHour * 4) + timezoneMinute / 15);
-                }
-
-            }
-
-            aTime.setValue(hour, minute, second, msecond, 0, timezonePart);
-
-            timeSerde.serialize(aTime, out);
-        } catch (HyracksDataException e) {
-            throw new HyracksDataException(time + errorMessage);
+            StringCharSequenceAccessor charAccessor = new StringCharSequenceAccessor();
+            charAccessor.reset(time, 0);
+            chrononTimeInMs = ADateAndTimeParser.parseTimePart(charAccessor);
+        } catch (Exception e) {
+            throw new HyracksDataException(e);
         }
+
+        aTime.setValue(chrononTimeInMs);
+
+        timeSerde.serialize(aTime, out);
     }
+
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
index f909b46..f295900 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
@@ -19,7 +19,7 @@
 import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class AUnorderedListSerializerDeserializer implements ISerializerDeserializer<AUnorderedList> {
 
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
index d155f6d..db9ac03 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
index 28f139a..4178b5a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
index 2627ff6..11b223a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
index 5d0977c..767f172 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACollectionCursor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACollectionCursor.java
index 20afc2e..23c0552 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACollectionCursor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACollectionCursor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 java.util.ArrayList;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
index f60c908..ea4c33b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
@@ -1,38 +1,39 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
 
+/**
+ * ADate type represents dates in a gregorian calendar system.
+ */
 public class ADate implements IAObject {
 
-    protected int day;
-    protected int month;
-    protected int year;
-    protected int timezone;
+    /**
+     * the number of full calendar days since the 1970-01-01 represented by the date value.
+     */
+    protected int chrononTimeInDay;
 
-    public ADate(int year, int month, int day, int timezone) {
-        this.day = day;
-        this.month = month;
-        this.year = year;
-        this.timezone = timezone;
-    }
+    private static long CHRONON_OF_DAY = 24 * 60 * 60 * 1000;
 
-    public int getDay() {
-        return day;
-    }
-
-    public int getMonth() {
-        return month;
-    }
-
-    public int getTimeZone() {
-        return timezone;
-    }
-
-    public int getYear() {
-        return year;
+    public ADate(int chrononTimeInDay) {
+        this.chrononTimeInDay = chrononTimeInDay;
     }
 
     public IAType getType() {
@@ -43,14 +44,13 @@
         if (!(o instanceof ADate)) {
             return false;
         } else {
-            ADate d = (ADate) o;
-            return d.getDay() == day && d.getMonth() == month && d.getYear() == year && d.getTimeZone() == timezone;
+            return ((ADate) o).chrononTimeInDay == this.chrononTimeInDay;
         }
     }
 
     @Override
     public int hashCode() {
-        return ((year * 31 + month) * 31 + day) * 31 + timezone;
+        return chrononTimeInDay;
     }
 
     @Override
@@ -70,6 +70,16 @@
 
     @Override
     public String toString() {
-        return "ADate: { " + year + "-" + month + "-" + day + ":" + timezone + " }";
+        StringBuilder sbder = new StringBuilder();
+        sbder.append("ADate: { ");
+        GregorianCalendarSystem.getInstance().getExtendStringRepWithTimezoneUntilField(
+                chrononTimeInDay * CHRONON_OF_DAY, 0, sbder, GregorianCalendarSystem.Fields.YEAR,
+                GregorianCalendarSystem.Fields.DAY);
+        sbder.append(" }");
+        return sbder.toString();
+    }
+
+    public int getChrononTimeInDays() {
+        return chrononTimeInDay;
     }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
index e300d78..e72fd8f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
@@ -1,73 +1,53 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
 
+/**
+ * ADateTime type represents the timestamp values.
+ * <p/>
+ * An ADateTime value contains the following time fields:<br/>
+ * - year;<br/>
+ * - month;<br/>
+ * - day;<br/>
+ * - hour; <br/>
+ * - minute; <br/>
+ * - second; <br/>
+ * - millisecond. <br/>
+ * By default, an ADateTime value is a UTC time value, i.e., there is no timezone information maintained. However user can use the timezone based AQL function to convert a UTC time to a timezone-embedded time.
+ * <p/>
+ * And the string representation of an ADateTime value follows the ISO8601 standard, in the following format:<br/>
+ * [+|-]YYYY-MM-DDThh:mm:ss.xxxZ
+ * <p/>
+ * Internally, an ADateTime value is stored as the number of milliseconds elapsed since 1970-01-01T00:00:00.000Z (also called chronon time). Functions to convert between a string representation of an ADateTime and its chronon time are implemented in {@link GregorianCalendarSystem}.
+ * <p/>
+ */
 public class ADateTime implements IAObject {
 
-    private static final int[] NUM_DAYS_IN_MONTH = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+    /**
+     * Represent the time interval as milliseconds since 1970-01-01T00:00:00.000Z.
+     */
+    protected long chrononTime;
 
-    protected int day;
-    protected int hour;
-    protected int minutes;
-    protected int month;
-    protected int seconds;
-    protected int timezone;
-    protected int year;
-    protected int milliseconds;
-    protected int microseconds;
-
-    public ADateTime(int year, int month, int day, int hour, int minutes, int seconds, int timezone) {
-        this.year = year;
-        this.month = month;
-        this.day = day;
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.timezone = timezone;
-    }
-
-    public ADateTime(int year, int month, int day, int hour, int minutes, int seconds, int milliseconds,
-            int microseconds, int timezone) {
-        this.year = year;
-        this.month = month;
-        this.day = day;
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.milliseconds = milliseconds;
-        this.microseconds = microseconds;
-        this.timezone = timezone;
-    }
-
-    public int getDay() {
-        return day;
-    }
-
-    public int getHours() {
-        return hour;
-    }
-
-    public int getMinutes() {
-        return minutes;
-    }
-
-    public int getMonth() {
-        return month;
-    }
-
-    public int getSeconds() {
-        return seconds;
-    }
-
-    public int getTimeZone() {
-        return timezone;
-    }
-
-    public int getYear() {
-        return year;
+    public ADateTime(long chrononTime) {
+        this.chrononTime = chrononTime;
     }
 
     @Override
@@ -75,125 +55,33 @@
         return BuiltinType.ADATETIME;
     }
 
-    public int getMicroseconds() {
-        return microseconds;
-    }
-
-    public int getMilliseconds() {
-        return milliseconds;
-    }
-
     public int compare(Object o) {
         if (!(o instanceof ADateTime)) {
             return -1;
         }
 
         ADateTime d = (ADateTime) o;
-        if (timezone != d.getTimeZone()) {
-            AMutableDateTime dt1 = new AMutableDateTime(year, month, day, hour, minutes, seconds, milliseconds,
-                    microseconds, timezone);
-            AMutableDateTime dt2 = new AMutableDateTime(d.getYear(), d.getMonth(), d.getDay(), d.getHours(),
-                    d.getMinutes(), d.getSeconds(), d.getMilliseconds(), d.getMicroseconds(), d.getTimeZone());
-            dt1.convertToUTC();
-            dt2.convertToUTC();
-
-            return dt1.tzEqualCompare(dt2);
-
-        }
-
-        return tzEqualCompare(d);
-    }
-
-    protected void convertToUTC() {
-        short tzMin = (short) ((timezone % 4) * 15);
-        short tzHr = (short) (timezone / 4);
-        minutes -= tzMin;
-        if (minutes >= 60) {
-            minutes %= 60;
-            hour += 1;
-        }
-        hour -= tzHr;
-        if (hour >= 24) {
-            hour %= 24;
-            day += 1;
-        }
-        if (isLeapYear(year) && month == 2) {
-            if (day >= 29) {
-                day %= 29;
-                month += 1;
-            }
+        if (this.chrononTime > d.chrononTime) {
+            return 1;
+        } else if (this.chrononTime < d.chrononTime) {
+            return -1;
         } else {
-            if (day >= NUM_DAYS_IN_MONTH[month - 1]) {
-                day %= NUM_DAYS_IN_MONTH[month - 1];
-                month += 1;
-            }
+            return 0;
         }
-
-        if (month >= 12) {
-            month %= 12;
-            year += 1;
-        }
-        timezone = 0;
-
-    }
-
-    protected static boolean isLeapYear(int year) {
-        if (year % 400 == 0) {
-            return true;
-        } else if (year % 100 == 0) {
-            return false;
-        } else if (year % 4 == 0) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    // comparison that assumes the timezones are the same!
-    protected int tzEqualCompare(ADateTime d) {
-        if (year != d.getYear()) {
-            return year - d.getYear();
-        }
-        if (month != d.getMonth()) {
-            return month - d.getMonth();
-        }
-        if (day != d.getDay()) {
-            return day - d.getDay();
-        }
-        if (hour != d.getHours()) {
-            return hour - d.getHours();
-        }
-        if (minutes != d.getMinutes()) {
-            return minutes - d.getMinutes();
-        }
-        if (seconds != d.getSeconds()) {
-            return seconds - d.getSeconds();
-        }
-        if (milliseconds != d.getMilliseconds()) {
-            return milliseconds - d.getMilliseconds();
-        }
-        if (microseconds != d.getMicroseconds()) {
-            return microseconds - d.getMicroseconds();
-        }
-
-        return 0;
     }
 
     public boolean equals(Object o) {
         if (!(o instanceof ADateTime)) {
             return false;
         } else {
-            ADateTime d = (ADateTime) o;
-            return d.getMicroseconds() == microseconds && d.getMilliseconds() == milliseconds
-                    && d.getSeconds() == seconds && d.getMinutes() == minutes && d.getHours() == hour
-                    && d.getDay() == day && d.getMonth() == month && d.getYear() == year && d.getTimeZone() == timezone;
+            ADateTime t = (ADateTime) o;
+            return t.chrononTime == this.chrononTime;
         }
     }
 
     @Override
     public int hashCode() {
-        return (((((((year * 31 + month) * 31 + day) * 31 + timezone) * 31 + hour) * 31 + minutes) * 31 + seconds) * 31 + milliseconds)
-                * 31 + microseconds;
+        return (int) (chrononTime ^ (chrononTime >>> 32));
     }
 
     @Override
@@ -213,8 +101,16 @@
 
     @Override
     public String toString() {
-        return "ADateTime: { " + year + "-" + month + "-" + day + ":" + hour + ":" + minutes + ":" + seconds + ":"
-                + milliseconds + ":" + microseconds + ":" + timezone + " }";
+        StringBuilder sbder = new StringBuilder();
+        sbder.append("ADateTime: { ");
+        GregorianCalendarSystem.getInstance().getExtendStringRepWithTimezoneUntilField(chrononTime, 0, sbder,
+                GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.MILLISECOND);
+        sbder.append(" }");
+        return sbder.toString();
+    }
+
+    public long getChrononTime() {
+        return chrononTime;
     }
 
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
index e8dd845..816b8be 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
@@ -1,3 +1,17 @@
+/*

+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;

diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
index 6f8064e..13f4a05 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
@@ -1,26 +1,67 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
 
+/**
+ * ADuration type represents time duration (unanchored time length) values.
+ * <p/>
+ * An ADuration value may contain the same fields as the {@link ADateTime}: <br/>
+ * - year;<br/>
+ * - month;<br/>
+ * - day;<br/>
+ * - hour; <br/>
+ * - minute; <br/>
+ * - second; <br/>
+ * - millisecond. <br/>
+ * Compared with {@link ADateTime}, a field in a duration value does not have the limited domain requirement. A duration field is valid as far as the value of the field is an integer.
+ * </p>
+ * We also support negative durations, which is not specified by ISO 8601, but has been
+ * supported by XML spec to enable the arithmetic operations between time instances.
+ * <p/>
+ * Internally, an ADuration value is stored as two fields: an integer field as the number of months for the YEAR and MONTH fields, and a long integer field as the number of milliseconds for the other fields.
+ * <p/>
+ */
 public class ADuration implements IAObject {
 
-    protected int months;
-    protected int seconds;
+    /**
+     * number of full months represented by the year-month part
+     */
+    protected int chrononInMonth;
 
-    public ADuration(int months, int seconds) {
-        this.months = months;
-        this.seconds = seconds;
+    /**
+     * number of milliseconds represented by the part other than the year and month
+     */
+    protected long chrononInMillisecond;
+
+    public ADuration(int months, long seconds) {
+        this.chrononInMonth = months;
+        this.chrononInMillisecond = seconds;
     }
 
     public int getMonths() {
-        return months;
+        return chrononInMonth;
     }
 
-    public int getSeconds() {
-        return seconds;
+    public long getMilliseconds() {
+        return chrononInMillisecond;
     }
 
     @Override
@@ -34,13 +75,13 @@
             return false;
         } else {
             ADuration d = (ADuration) o;
-            return d.getMonths() == months && d.getSeconds() == seconds;
+            return d.getMonths() == chrononInMonth && d.getMilliseconds() == chrononInMillisecond;
         }
     }
 
     @Override
     public int hashCode() {
-        return months * 31 + seconds;
+        return (int) (chrononInMonth ^ (chrononInMillisecond) ^ (chrononInMillisecond >>> 32));
     }
 
     @Override
@@ -58,4 +99,14 @@
         return hashCode();
     }
 
+    @Override
+    public String toString() {
+        StringBuilder sbder = new StringBuilder();
+        sbder.append("ADuration: {");
+        GregorianCalendarSystem.getInstance().getDurationExtendStringRepWithTimezoneUntilField(chrononInMillisecond,
+                chrononInMonth, sbder);
+        sbder.append(" }");
+        return sbder.toString();
+    }
+
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
index 8404b5e..a66e198 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
index 75fe896..bd27f20 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
index 86c071b..b656a57 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
@@ -1,3 +1,17 @@
+/*

+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;

diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
index 36d482a..193a4af 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
index 5dabba5..87e5472 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
index d96830a..0285825 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableCircle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableCircle.java
index f85470e..84b35fb 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableCircle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableCircle.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableCircle extends ACircle {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDate.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDate.java
index 78a87b8..7a5fa02 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDate.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDate.java
@@ -1,16 +1,27 @@
+/*
+ * Copyright 2009-2011 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 AMutableDate extends ADate {
 
-    public AMutableDate(int year, int month, int day, int timezone) {
-        super(year, month, day, timezone);
+    public AMutableDate(int chrononTimeInDays) {
+        super(chrononTimeInDays);
     }
 
-    public void setValue(int year, int month, int day, int timezone) {
-        this.year = year;
-        this.month = month;
-        this.day = day;
-        this.timezone = timezone;
+    public void setValue(int chrononTimeInDays) {
+        this.chrononTimeInDay = chrononTimeInDays;
     }
 
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDateTime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDateTime.java
index 01e30a2..576c8e3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDateTime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDateTime.java
@@ -1,23 +1,27 @@
+/*
+ * Copyright 2009-2011 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 AMutableDateTime extends ADateTime {
 
-    public AMutableDateTime(int year, int month, int day, int hour, int minutes, int seconds, int milliseconds,
-            int microseconds, int timezone) {
-        super(year, month, day, hour, minutes, seconds, milliseconds, microseconds, timezone);
+    public AMutableDateTime(long chrononTime) {
+        super(chrononTime);
     }
 
-    public void setValue(int year, int month, int day, int hour, int minutes, int seconds, int milliseconds,
-            int microseconds, int timezone) {
-        this.year = year;
-        this.month = month;
-        this.day = day;
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.milliseconds = milliseconds;
-        this.microseconds = microseconds;
-        this.timezone = timezone;
+    public void setValue(long chrononTime) {
+        this.chrononTime = chrononTime;
     }
 
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDouble.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDouble.java
index 849879e..e7fa620 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDouble.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDouble.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableDouble extends ADouble {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDuration.java
index f776817..ecea300 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDuration.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableDuration.java
@@ -1,14 +1,28 @@
+/*
+ * Copyright 2009-2011 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 AMutableDuration extends ADuration {
 
-    public AMutableDuration(int months, int seconds) {
-        super(months, seconds);
+    public AMutableDuration(int months, long milliseconds) {
+        super(months, milliseconds);
     }
 
-    public void setValue(int months, int seconds) {
-        this.months = months;
-        this.seconds = seconds;
+    public void setValue(int months, long milliseconds) {
+        this.chrononInMonth = months;
+        this.chrononInMillisecond = milliseconds;
     }
 
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableFloat.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableFloat.java
index 4752631..fbc3de2 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableFloat.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableFloat.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableFloat extends AFloat {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt16.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt16.java
index 3fdd468..3c242bd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt16.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt16.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableInt16 extends AInt16 {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt32.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt32.java
index 94a97a8..dd15e62 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt32.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt32.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableInt32 extends AInt32 {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt64.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt64.java
index 41188ac..5c6a90c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt64.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt64.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableInt64 extends AInt64 {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt8.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt8.java
index f33a251..f8a3de9 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt8.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableInt8.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableInt8 extends AInt8 {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableLine.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableLine.java
index 4204e7a..0786d51 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableLine.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableLine.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableLine extends ALine {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableOrderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableOrderedList.java
index aa581ea..619ebaa 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableOrderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableOrderedList.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 java.util.ArrayList;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint.java
index 520ae7a..b33f961 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutablePoint extends APoint {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint3D.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint3D.java
index 80687b1..3fa3b26 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint3D.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePoint3D.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutablePoint3D extends APoint3D {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePolygon.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePolygon.java
index f78ab17..2f592ff 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePolygon.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutablePolygon.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutablePolygon extends APolygon {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRecord.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRecord.java
index 19ccd2a..08b45a0 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRecord.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRecord.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.om.types.ARecordType;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRectangle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRectangle.java
index e156264..c05376c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRectangle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableRectangle.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableRectangle extends ARectangle {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableString.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableString.java
index 8f778b3..4a3beec 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableString.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableString.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 AMutableString extends AString {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableTime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableTime.java
index a23b8e3..10a7249 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableTime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableTime.java
@@ -1,17 +1,27 @@
+/*
+ * Copyright 2009-2011 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 AMutableTime extends ATime {
 
-    public AMutableTime(int hour, int minutes, int seconds, int milliseconds, int microseconds, int timezone) {
-        super(hour, minutes, seconds, milliseconds, microseconds, timezone);
+    public AMutableTime(int timeInMillisec) {
+        super(timeInMillisec);
     }
 
-    public void setValue(int hour, int minutes, int seconds, int milliseconds, int microseconds, int timezone) {
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.milliseconds = milliseconds;
-        this.timezone = timezone;
+    public void setValue(int timeInMillisec) {
+        this.chrononTime = timeInMillisec;
     }
 
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
index ece4026..71c3986 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AMutableUnorderedList.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 java.util.ArrayList;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
index a5f5a3c..be47b41 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
index 9c21986..4f5effd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 java.util.ArrayList;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
index 1e80a8c..8e261a2 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
index e937b68..29ef6cd 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
index cdeacac..29e3727 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
index f1f1255..0d1f578 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
index bcf9e8e..51f06bf 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
index ce78dcb..0f7c9c2 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
@@ -1,3 +1,17 @@
+/*

+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;

diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
index f948ffc..7b66cf9 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
@@ -1,49 +1,34 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 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 ATime implements IAObject {
 
-    protected int hour;
-    protected int minutes;
-    protected int seconds;
-    protected int timezone;
-    protected int milliseconds;
-    protected int microseconds;
+    /**
+     * number of milliseconds since the beginning of a day represented by this time value
+     */
+    protected int chrononTime;
 
-    public ATime(int hour, int minutes, int seconds, int timezone) {
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.timezone = timezone;
-    }
-
-    public ATime(int hour, int minutes, int seconds, int milliseconds, int microseconds, int timezone) {
-        this.hour = hour;
-        this.minutes = minutes;
-        this.seconds = seconds;
-        this.milliseconds = milliseconds;
-        this.microseconds = microseconds;
-        this.timezone = timezone;
-    }
-
-    public int getHours() {
-        return hour;
-    }
-
-    public int getMinutes() {
-        return minutes;
-    }
-
-    public int getSeconds() {
-        return seconds;
-    }
-
-    public int getTimeZone() {
-        return timezone;
+    public ATime(int chrononTime) {
+        this.chrononTime = chrononTime;
     }
 
     @Override
@@ -51,29 +36,36 @@
         return BuiltinType.ATIME;
     }
 
-    public int getMicroseconds() {
-        return microseconds;
-    }
+    public int compare(Object o) {
+        if (!(o instanceof ATime)) {
+            return -1;
+        }
 
-    public int getMilliseconds() {
-        return milliseconds;
+        ATime d = (ATime) o;
+        if (this.chrononTime > d.chrononTime) {
+            return 1;
+        } else if (this.chrononTime < d.chrononTime) {
+            return -1;
+        } else {
+            return 0;
+        }
     }
 
     @Override
     public boolean equals(Object o) {
+
         if (!(o instanceof ATime)) {
             return false;
         } else {
             ATime t = (ATime) o;
-            return t.getMicroseconds() == microseconds && t.getMilliseconds() == milliseconds
-                    && t.getSeconds() == seconds && t.getMinutes() == minutes && t.getHours() == hour
-                    && t.getTimeZone() == timezone;
+            return t.chrononTime == this.chrononTime;
+
         }
     }
 
     @Override
     public int hashCode() {
-        return ((((timezone * 31 + hour) * 31 + minutes) * 31 + seconds) * 31 + milliseconds) * 31 + microseconds;
+        return chrononTime;
     }
 
     @Override
@@ -93,7 +85,17 @@
 
     @Override
     public String toString() {
-        return "ATime: { " + hour + ":" + minutes + ":" + seconds + ":" + milliseconds + ":" + microseconds + ":"
-                + timezone + " }";
+        StringBuilder sbder = new StringBuilder();
+        sbder.append("ATime: { ");
+        GregorianCalendarSystem.getInstance().getExtendStringRepWithTimezoneUntilField(chrononTime, 0, sbder,
+                GregorianCalendarSystem.Fields.HOUR, GregorianCalendarSystem.Fields.MILLISECOND);
+        sbder.append(" }");
+        return sbder.toString();
+
     }
+
+    public int getChrononTime() {
+        return chrononTime;
+    }
+
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
index 2ce8363..764d05b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 java.util.ArrayList;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACollection.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACollection.java
index 03b7cad..db7134a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACollection.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACollection.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 interface IACollection extends IAObject {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACursor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACursor.java
index ecbbde3..2da505c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACursor.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IACursor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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.
+ */
 /**
  * 
  */
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
index d98d181..463154b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 edu.uci.ics.asterix.common.exceptions.AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/InMemUtils.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/InMemUtils.java
index 905ca5f..4d4e2b1 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/InMemUtils.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/InMemUtils.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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 InMemUtils {
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateAndTimeParser.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateAndTimeParser.java
new file mode 100644
index 0000000..30ee525
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADateAndTimeParser.java
@@ -0,0 +1,264 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+public class ADateAndTimeParser {
+
+    private static final GregorianCalendarSystem gCalInstance = GregorianCalendarSystem.getInstance();
+
+    private static final String dateErrorMessage = "Wrong date format!";
+    private static final String timeErrorMessage = "Wrong time format!";
+
+    /**
+     * Parse the given char sequence as a date string, and return the milliseconds represented by the date.
+     * 
+     * @param charAccessor
+     *            accessor for the char sequence
+     * @param isDateOnly
+     *            indicating whether it is a single date string, or it is the date part of a datetime string
+     * @param errorMessage
+     * @return
+     * @throws Exception
+     */
+    public static <T> long parseDatePart(ICharSequenceAccessor<T> charAccessor, boolean isDateOnly) throws Exception {
+
+        int length = charAccessor.getLength();
+        int offset = 0;
+
+        int year = 0, month = 0, day = 0;
+        boolean positive = true;
+
+        boolean isExtendedForm = false;
+
+        if (charAccessor.getCharAt(offset) == '-') {
+            offset++;
+            positive = false;
+        }
+
+        if ((isDateOnly) && charAccessor.getCharAt(offset + 4) == '-' || (!isDateOnly)
+                && charAccessor.getCharAt(offset + 13) == ':') {
+            isExtendedForm = true;
+        }
+
+        if (isExtendedForm) {
+            if (charAccessor.getCharAt(offset + 4) != '-' || charAccessor.getCharAt(offset + 7) != '-') {
+                throw new Exception(dateErrorMessage);
+            }
+        }
+
+        // year
+        for (int i = 0; i < 4; i++) {
+            if (charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9') {
+                year = year * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(dateErrorMessage);
+            }
+        }
+
+        if (year < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.YEAR.ordinal()]
+                || year > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.YEAR.ordinal()]) {
+            throw new Exception(dateErrorMessage + ": year " + year);
+        }
+
+        offset += (isExtendedForm) ? 5 : 4;
+
+        // month
+        for (int i = 0; i < 2; i++) {
+            if ((charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9')) {
+                month = month * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(dateErrorMessage);
+            }
+        }
+
+        if (month < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.MONTH.ordinal()]
+                || month > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.MONTH.ordinal()]) {
+            throw new Exception(dateErrorMessage + ": month " + month);
+        }
+        offset += (isExtendedForm) ? 3 : 2;
+
+        // day
+        for (int i = 0; i < 2; i++) {
+            if ((charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9')) {
+                day = day * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(dateErrorMessage);
+            }
+        }
+
+        if (day < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.DAY.ordinal()]
+                || day > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.DAY.ordinal()]) {
+            throw new Exception(dateErrorMessage + ": day " + day);
+        }
+
+        offset += 2;
+
+        if (!positive) {
+            year *= -1;
+        }
+
+        if (isDateOnly && length > offset) {
+            throw new Exception(dateErrorMessage);
+        }
+        return gCalInstance.getChronon(year, month, day, 0, 0, 0, 0, 0);
+    }
+
+    /**
+     * Parse the given char sequence as a time string, and return the milliseconds represented by the time.
+     * 
+     * @param charAccessor
+     * @return
+     * @throws Exception
+     */
+    public static <T> int parseTimePart(ICharSequenceAccessor<T> charAccessor) throws Exception {
+
+        int length = charAccessor.getLength();
+        int offset = 0;
+
+        int hour = 0, min = 0, sec = 0, millis = 0;
+        int timezone = 0;
+
+        boolean isExtendedForm = false;
+        if (charAccessor.getCharAt(offset + 2) == ':') {
+            isExtendedForm = true;
+        }
+
+        if (isExtendedForm && (charAccessor.getCharAt(offset + 2) != ':' || charAccessor.getCharAt(offset + 5) != ':')) {
+            throw new Exception(timeErrorMessage);
+        }
+        // hour
+        for (int i = 0; i < 2; i++) {
+            if ((charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9')) {
+                hour = hour * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(timeErrorMessage);
+            }
+        }
+
+        if (hour < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.HOUR.ordinal()]
+                || hour > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.HOUR.ordinal()]) {
+            throw new Exception(timeErrorMessage + ": hour " + hour);
+        }
+
+        offset += (isExtendedForm) ? 3 : 2;
+
+        // minute
+        for (int i = 0; i < 2; i++) {
+            if ((charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9')) {
+                min = min * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(timeErrorMessage);
+            }
+        }
+
+        if (min < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.MINUTE.ordinal()]
+                || min > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.MINUTE.ordinal()]) {
+            throw new Exception(timeErrorMessage + ": min " + min);
+        }
+
+        offset += (isExtendedForm) ? 3 : 2;
+
+        // second
+        for (int i = 0; i < 2; i++) {
+            if ((charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9')) {
+                sec = sec * 10 + charAccessor.getCharAt(offset + i) - '0';
+            } else {
+                throw new Exception(timeErrorMessage);
+            }
+        }
+
+        if (sec < GregorianCalendarSystem.FIELD_MINS[GregorianCalendarSystem.Fields.SECOND.ordinal()]
+                || sec > GregorianCalendarSystem.FIELD_MAXS[GregorianCalendarSystem.Fields.SECOND.ordinal()]) {
+            throw new Exception(timeErrorMessage + ": sec " + sec);
+        }
+
+        offset += 2;
+
+        if ((isExtendedForm && length > offset && charAccessor.getCharAt(offset) == '.')
+                || (!isExtendedForm && length > offset)) {
+
+            offset += (isExtendedForm) ? 1 : 0;
+            int i = 0;
+            for (; i < 3 && offset + i < length; i++) {
+                if (charAccessor.getCharAt(offset + i) >= '0' && charAccessor.getCharAt(offset + i) <= '9') {
+                    millis = millis * 10 + charAccessor.getCharAt(offset + i) - '0';
+                } else {
+                    break;
+                }
+            }
+
+            offset += i;
+
+            for (; i < 3; i++) {
+                millis = millis * 10;
+            }
+
+            // error is thrown if more than three digits are seen for the millisecond part
+            if (charAccessor.getCharAt(offset) >= '0' && charAccessor.getCharAt(offset) <= '9') {
+                throw new Exception("Wrong format of time instance: too many fields for millisecond.");
+            }
+        }
+
+        if (length > offset) {
+            if (charAccessor.getCharAt(offset) != 'Z') {
+                if ((charAccessor.getCharAt(offset) != '+' && charAccessor.getCharAt(offset) != '-')
+                        || (isExtendedForm && charAccessor.getCharAt(offset + 3) != ':')) {
+                    throw new Exception(timeErrorMessage);
+                }
+
+                short timezoneHour = 0;
+                short timezoneMinute = 0;
+
+                for (int i = 0; i < 2; i++) {
+                    if ((charAccessor.getCharAt(offset + 1 + i) >= '0' && charAccessor.getCharAt(offset + 1 + i) <= '9')) {
+                        timezoneHour = (short) (timezoneHour * 10 + charAccessor.getCharAt(offset + 1 + i) - '0');
+                    } else {
+                        throw new Exception(timeErrorMessage);
+                    }
+                }
+
+                if (timezoneHour < GregorianCalendarSystem.TIMEZONE_HOUR_MIN
+                        || timezoneHour > GregorianCalendarSystem.TIMEZONE_HOUR_MAX) {
+                    throw new Exception(timeErrorMessage + ": time zone hour " + timezoneHour);
+                }
+
+                int temp_offset = (isExtendedForm) ? 1 : 0;
+
+                for (int i = 0; i < 2; i++) {
+                    if ((charAccessor.getCharAt(offset + temp_offset + 3 + i) >= '0' && charAccessor.getCharAt(offset
+                            + temp_offset + 3 + i) <= '9')) {
+                        timezoneMinute = (short) (timezoneMinute * 10
+                                + charAccessor.getCharAt(offset + temp_offset + 3 + i) - '0');
+                    } else {
+                        throw new Exception(timeErrorMessage);
+                    }
+                }
+
+                if (timezoneMinute < GregorianCalendarSystem.TIMEZONE_MIN_MIN
+                        || timezoneMinute > GregorianCalendarSystem.TIMEZONE_MIN_MAX) {
+                    throw new Exception(timeErrorMessage + ": time zone minute " + timezoneMinute);
+                }
+
+                if (charAccessor.getCharAt(offset) == '-') {
+                    timezone = (byte) -((timezoneHour * 4) + timezoneMinute / 15);
+                } else {
+                    timezone = (byte) ((timezoneHour * 4) + timezoneMinute / 15);
+                }
+            }
+        }
+
+        return gCalInstance.getChronon(hour, min, sec, millis, timezone);
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParser.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParser.java
new file mode 100644
index 0000000..5d43bba
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ADurationParser.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+import edu.uci.ics.asterix.om.base.AMutableDuration;
+
+public class ADurationParser {
+
+    private enum State {
+        NOTHING_READ,
+        YEAR,
+        MONTH,
+        DAY,
+        TIME,
+        HOUR,
+        MIN,
+        MILLISEC,
+        SEC;
+    };
+
+    private static final String errorMessage = "This can not be an instance of duration";
+
+    public static <T> void parse(ICharSequenceAccessor<T> charAccessor, AMutableDuration aDuration) throws Exception {
+
+        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.getCharAt(offset) == '-') {
+            offset++;
+            positive = false;
+        }
+
+        if (charAccessor.getCharAt(offset++) != 'P') {
+            throw new Exception(errorMessage);
+        }
+
+        for (; offset < charAccessor.getLength(); offset++) {
+            if (charAccessor.getCharAt(offset) >= '0' && charAccessor.getCharAt(offset) <= '9') {
+                // accumulate the digit fields
+                value = value * 10 + charAccessor.getCharAt(offset) - '0';
+            } else {
+                switch (charAccessor.getCharAt(offset)) {
+                    case 'Y':
+                        if (state.compareTo(State.YEAR) < 0) {
+                            year = value;
+                            state = State.YEAR;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+                    case 'M':
+                        if (state.compareTo(State.TIME) < 0) {
+                            if (state.compareTo(State.MONTH) < 0) {
+                                month = value;
+                                state = State.MONTH;
+                            } else {
+                                throw new Exception(errorMessage);
+                            }
+                        } else if (state.compareTo(State.MIN) < 0) {
+                            minute = value;
+                            state = State.MIN;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+                    case 'D':
+                        if (state.compareTo(State.DAY) < 0) {
+                            day = value;
+                            state = State.DAY;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+                    case 'T':
+                        if (state.compareTo(State.TIME) < 0) {
+                            state = State.TIME;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+
+                    case 'H':
+                        if (state.compareTo(State.HOUR) < 0) {
+                            hour = value;
+                            state = State.HOUR;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+                    case '.':
+                        if (state.compareTo(State.MILLISEC) < 0) {
+                            int i = 1;
+                            for (; offset + i < charAccessor.getLength(); i++) {
+                                if (charAccessor.getCharAt(offset + i) >= '0'
+                                        && charAccessor.getCharAt(offset + i) <= '9') {
+                                    if (i < 4) {
+                                        millisecond = millisecond * 10 + (charAccessor.getCharAt(offset + i) - '0');
+                                    } else {
+                                        throw new Exception(errorMessage);
+                                    }
+                                } else {
+                                    break;
+                                }
+                            }
+                            offset += i;
+                            state = State.MILLISEC;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                    case 'S':
+                        if (state.compareTo(State.SEC) < 0) {
+                            second = value;
+                            state = State.SEC;
+                        } else {
+                            throw new Exception(errorMessage);
+                        }
+                        break;
+                    default:
+                        throw new Exception(errorMessage);
+
+                }
+                value = 0;
+            }
+        }
+
+        if (state.compareTo(State.TIME) == 0) {
+            throw new Exception(errorMessage);
+        }
+
+        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));
+
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ByteArrayCharSequenceAccessor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ByteArrayCharSequenceAccessor.java
new file mode 100644
index 0000000..e1a2135
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ByteArrayCharSequenceAccessor.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+public class ByteArrayCharSequenceAccessor implements ICharSequenceAccessor<Byte[]> {
+
+    private byte[] string;
+    private int offset;
+    private int beginOffset;
+
+    @Override
+    public char getCharAt(int index) {
+        return (char) (string[index + offset + beginOffset]);
+    }
+
+    /* The offset is the position of the first letter in the byte array */
+    public void reset(byte[] obj, int beginOffset, int offset) {
+        string = obj;
+        this.offset = offset;
+        this.beginOffset = beginOffset;
+    }
+
+    @Override
+    public int getLength() {
+        return ((string[beginOffset - 2] & 0xff) << 8) + ((string[beginOffset - 1] & 0xff) << 0) - offset;
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/GregorianCalendarSystem.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/GregorianCalendarSystem.java
new file mode 100644
index 0000000..149a1d2
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/GregorianCalendarSystem.java
@@ -0,0 +1,688 @@
+/*
+ * Copyright 2009-2012 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.
+ *
+ * Joda API (http://joda-time.sourceforge.net/) is under the protection of:
+ * 
+ * Copyright 2001-2005 Stephen Colebourne
+ *
+ * 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 at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.om.base.temporal;
+
+/**
+ * A simple implementation of the Gregorian calendar system.
+ * <p/>
+ */
+public class GregorianCalendarSystem implements ICalendarSystem {
+
+    public enum Fields {
+        YEAR,
+        MONTH,
+        DAY,
+        HOUR,
+        MINUTE,
+        SECOND,
+        MILLISECOND
+    };
+
+    //public static final int YEAR = 0, MONTH = 1, DAY = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6;
+
+    public static final int[] DAYS_OF_MONTH_ORDI = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+    public static final int[] DAYS_OF_MONTH_LEAP = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+
+    public static final int[] DAYS_SINCE_MONTH_BEGIN_ORDI = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+
+    public static final int CHRONON_OF_SECOND = 1000;
+    public static final int CHRONON_OF_MINUTE = 60 * CHRONON_OF_SECOND;
+    public static final int CHRONON_OF_HOUR = 60 * CHRONON_OF_MINUTE;
+    public static final long CHRONON_OF_DAY = 24 * CHRONON_OF_HOUR;
+
+    /**
+     * Minimum feasible value of each field
+     */
+    public static final int[] FIELD_MINS = { Integer.MIN_VALUE, // year
+            1, // month
+            1, // day
+            0, // hour
+            0, // minute
+            0, // second
+            0 // millisecond
+    };
+
+    public static final int[] FIELD_MAXS = { Integer.MAX_VALUE, // year
+            12, // month
+            31, // day
+            23, // hour
+            59, // minute
+            59, // second
+            999 // millisecond
+    };
+
+    public static final int TIMEZONE_HOUR_MIN = -12, TIMEZONE_HOUR_MAX = 14, TIMEZONE_MIN_MIN = -60,
+            TIMEZONE_MIN_MAX = 60;
+
+    /**
+     * From Joda API: GregorianChronology.java
+     */
+    private static final long CHRONON_OF_YEAR = (long) (365.2425 * CHRONON_OF_DAY);
+
+    /**
+     * From Joda API: GregorianChronology.java
+     */
+    private static final int DAYS_0000_TO_1970 = 719527;
+
+    private static final GregorianCalendarSystem instance = new GregorianCalendarSystem();
+
+    private GregorianCalendarSystem() {
+    }
+
+    public static GregorianCalendarSystem getInstance() {
+        return instance;
+    }
+
+    /**
+     * Check whether the given date time value is a valid date time following the gregorian calendar system.
+     * 
+     * @param fields
+     * @return
+     */
+    public boolean validate(int year, int month, int day, int hour, int min, int sec, int millis) {
+        // Check whether each field is within the value domain
+        if (year < FIELD_MINS[0] || year > FIELD_MAXS[0]) {
+            return false;
+        }
+        if (month < FIELD_MINS[1] || month > FIELD_MAXS[1]) {
+            return false;
+        }
+        if (day < FIELD_MINS[2] || day > FIELD_MAXS[2]) {
+            return false;
+        }
+        if (hour < FIELD_MINS[3] || hour > FIELD_MAXS[3]) {
+            return false;
+        }
+        if (min < FIELD_MINS[4] || min > FIELD_MAXS[4]) {
+            return false;
+        }
+        if (sec < FIELD_MINS[5] || sec > FIELD_MAXS[5]) {
+            return false;
+        }
+        if (millis < FIELD_MINS[6] || millis > FIELD_MAXS[6]) {
+            return false;
+        }
+
+        // Check whether leap month.
+        if (month == 2) {
+            if (isLeapYear(year)) {
+                if (month > DAYS_OF_MONTH_LEAP[1]) {
+                    return false;
+                }
+            } else {
+                if (month > DAYS_OF_MONTH_ORDI[1]) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Check whether the given time zone value is a valid time zone following the gregorian calendar system.
+     * <p/>
+     * The valid timezone is within the range of:<br/>
+     * - Hours: UTC -12 (Y, or Yankee Time Zone) to UTC +14 (LINT, or Line Islands Time) <br/>
+     * - Minutes: currently the available minutes include 00, 30 and 45.
+     * <p/>
+     * Reference: http://www.timeanddate.com/library/abbreviations/timezones/
+     * <p/>
+     * 
+     * @param timezone
+     * @return
+     */
+    public boolean validateTimeZone(int timezone) {
+        short tzMin = (short) ((timezone % 4) * 15);
+
+        if (tzMin < -60 || tzMin >= 60) {
+            return false;
+        }
+
+        short tzHr = (short) (timezone / 4);
+
+        if (tzHr < -12 && tzHr > 14) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Validate the given chronon time and time zone.
+     * 
+     * @param year
+     * @param month
+     * @param day
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public boolean validate(int year, int month, int day, int hour, int min, int sec, int millis, int timezone) {
+        return validate(year, month, day, hour, min, sec, millis) && validateTimeZone(timezone);
+    }
+
+    /**
+     * Get the UTC chronon time of the given date time and time zone.
+     * 
+     * @param year
+     * @param month
+     * @param day
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public long getChronon(int year, int month, int day, int hour, int min, int sec, int millis, int timezone) {
+        // Added milliseconds for all fields but month and day
+        long chrononTime = chrononizeBeginningOfYear(year) + (hour - timezone / 4) * CHRONON_OF_HOUR
+                + (min - (timezone % 4) * 15) * CHRONON_OF_MINUTE + sec * CHRONON_OF_SECOND + millis;
+
+        // Added milliseconds for days of the month. 
+        chrononTime += (day - 1 + DAYS_SINCE_MONTH_BEGIN_ORDI[month - 1]) * CHRONON_OF_DAY;
+
+        // Adjust the leap year
+        if (month > 2 && isLeapYear(year)) {
+            chrononTime += CHRONON_OF_DAY;
+        }
+
+        return chrononTime;
+    }
+
+    /**
+     * Get the chronon time (number of milliseconds) of the given time and time zone.
+     * 
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public int getChronon(int hour, int min, int sec, int millis, int timezone) {
+        // Added milliseconds for all fields but month and day
+        int chrononTime = (hour - timezone / 4) * CHRONON_OF_HOUR + (min - (timezone % 4) * 15) * CHRONON_OF_MINUTE
+                + sec * CHRONON_OF_SECOND + millis;
+        return chrononTime;
+    }
+
+    /**
+     * Get the extended string representation of the given UTC chronon time under the given time zone. Only fields before
+     * the given field index will be returned.
+     * <p/>
+     * The extended string representation is like:<br/>
+     * [-]YYYY-MM-DDThh:mm:ss.xxx[Z|[+|-]hh:mm]
+     * 
+     * @param chrononTime
+     * @param timezone
+     * @param sbder
+     * @param untilField
+     */
+    public void getExtendStringRepWithTimezoneUntilField(long chrononTime, int timezone, StringBuilder sbder,
+            Fields startField, Fields untilField) {
+
+        int year = getYear(chrononTime);
+        int month = getMonthOfYear(chrononTime, year);
+
+        switch (startField) {
+            case YEAR:
+                sbder.append(String.format(year < 0 ? "%05d" : "%04d", year));
+                if (untilField == Fields.YEAR) {
+                    return;
+                }
+            case MONTH:
+                if (startField != Fields.MONTH) {
+                    sbder.append("-");
+                }
+                sbder.append(String.format("%02d", month));
+                if (untilField == Fields.MONTH) {
+                    return;
+                }
+            case DAY:
+                if (startField != Fields.DAY) {
+                    sbder.append("-");
+                }
+                sbder.append(String.format("%02d", getDayOfMonthYear(chrononTime, year, month)));
+                if (untilField == Fields.DAY) {
+                    break;
+                }
+            case HOUR:
+                if (startField != Fields.HOUR) {
+                    sbder.append("T");
+                }
+                sbder.append(String.format("%02d", getHourOfDay(chrononTime)));
+                if (untilField == Fields.HOUR) {
+                    break;
+                }
+            case MINUTE:
+                if (startField != Fields.MINUTE) {
+                    sbder.append(":");
+                }
+                sbder.append(String.format("%02d", getMinOfHour(chrononTime)));
+                if (untilField == Fields.MINUTE) {
+                    break;
+                }
+            case SECOND:
+                if (startField != Fields.SECOND) {
+                    sbder.append(":");
+                }
+                sbder.append(String.format("%02d", getSecOfMin(chrononTime)));
+                // add millisecond as the precision fields of a second
+                sbder.append(".").append(String.format("%03d", getMillisOfSec(chrononTime)));
+                break;
+        }
+
+        if (untilField.compareTo(Fields.DAY) > 0) {
+            sbder.append("Z");
+        } else {
+            short tzMin = (short) ((timezone % 4) * 15);
+            short tzHr = (short) (timezone / 4);
+            sbder.append((tzHr >= 0 ? "+" : "-")).append(String.format("%02d", (tzHr < 0 ? -tzHr : tzHr))).append(":")
+                    .append(String.format("%02d", tzMin));
+        }
+    }
+
+    /**
+     * Get the basic string representation of a chronon time with the given time zone.
+     * 
+     * @param chrononTime
+     * @param timezone
+     * @param sbder
+     */
+    public void getBasicStringRepWithTimezoneUntilField(long chrononTime, int timezone, StringBuilder sbder,
+            Fields startField, Fields untilField) {
+        int year = getYear(chrononTime);
+        int month = getMonthOfYear(chrononTime, year);
+
+        switch (startField) {
+            case YEAR:
+                sbder.append(String.format(year < 0 ? "%05d" : "%04d", year));
+                if (untilField == Fields.YEAR) {
+                    return;
+                }
+            case MONTH:
+                sbder.append(String.format("%02d", month));
+                if (untilField == Fields.MONTH) {
+                    return;
+                }
+            case DAY:
+                sbder.append(String.format("%02d", getDayOfMonthYear(chrononTime, year, month)));
+                if (untilField == Fields.DAY) {
+                    break;
+                }
+            case HOUR:
+                sbder.append(String.format("%02d", getHourOfDay(chrononTime)));
+                if (untilField == Fields.HOUR) {
+                    break;
+                }
+            case MINUTE:
+                sbder.append(String.format("%02d", getMinOfHour(chrononTime)));
+                if (untilField == Fields.MINUTE) {
+                    break;
+                }
+            case SECOND:
+                sbder.append(String.format("%02d", getSecOfMin(chrononTime)));
+                // add millisecond as the precision fields of a second
+                sbder.append(String.format("%03d", getMillisOfSec(chrononTime)));
+                break;
+        }
+
+        if (untilField.compareTo(Fields.DAY) > 0) {
+            sbder.append("Z");
+        } else {
+            short tzMin = (short) ((timezone % 4) * 15);
+            short tzHr = (short) (timezone / 4);
+            sbder.append((tzHr >= 0 ? "+" : "-")).append(String.format("%02d", (tzHr < 0 ? -tzHr : tzHr)))
+                    .append(String.format("%02d", tzMin));
+        }
+    }
+
+    /**
+     * Get the extended string representation of the given months and milliseconds (duration) time. *
+     * <p/>
+     * The extended and simple string representation is like:<br/>
+     * [-]PnYnMnDTnHnMnS
+     * 
+     * @param milliseconds
+     * @param months
+     * @param sbder
+     */
+
+    public void getDurationExtendStringRepWithTimezoneUntilField(long milliseconds, int months, StringBuilder sbder) {
+
+        boolean positive = true;
+
+        // set the negative flag. "||" is necessary in case that months field is not there (so it is 0)
+        if (months < 0 || milliseconds < 0) {
+            months *= -1;
+            milliseconds *= -1;
+            positive = false;
+        }
+
+        int month = getDurationMonth(months);
+        int year = getDurationYear(months);
+        int millisecond = getDurationMillisecond(milliseconds);
+        int second = getDurationSecond(milliseconds);
+        int minute = getDurationMinute(milliseconds);
+        int hour = getDurationHour(milliseconds);
+        int day = getDurationDay(milliseconds);
+
+        if (!positive) {
+            sbder.append("-");
+        }
+        sbder.append("P");
+        sbder.append((year != 0) ? year + "Y" : "");
+        sbder.append((month != 0) ? month + "M" : "");
+        sbder.append((day != 0) ? day + "D" : "");
+        sbder.append((hour != 0 || minute != 0 || second != 0 || millisecond != 0) ? "T" : "");
+        sbder.append((hour != 0) ? hour + "H" : "");
+        sbder.append((minute != 0) ? minute + "M" : "");
+        sbder.append((second != 0 || millisecond != 0) ? second : "");
+        if (millisecond > 0) {
+            sbder.append("." + millisecond);
+        }
+        sbder.append((second != 0 || millisecond != 0) ? "S" : "");
+    }
+
+    /**
+     * Check whether a given year is a leap year.
+     * 
+     * @param year
+     * @return
+     */
+    protected boolean isLeapYear(int year) {
+        return ((year & 3) == 0) && ((year % 100) != 0 || (year % 400) == 0);
+    }
+
+    /**
+     * From Joda library GregorianChronology class: The basic calculation is
+     * (y / 4) - (y / 100) + (y / 400). <br/>
+     * Use y >> 2 ( (y + 3) >> 2 for negative y value) to replace y / 4 reveals eliminates two divisions.
+     * 
+     * @param year
+     * @return
+     */
+    private long chrononizeBeginningOfYear(int year) {
+        int leapYears = year / 100;
+        if (year < 0) {
+            // From Joda library GregorianChronology class
+            // The basic calculation is (y / 4) - (y / 100) + (y / 400)
+            // Use (y + 3) >> 2 to replace y / 4 reveals eliminates two divisions.
+            leapYears = ((year + 3) >> 2) - leapYears + ((leapYears + 3) >> 2) - 1;
+        } else {
+            leapYears = (year >> 2) - leapYears + (leapYears >> 2);
+            if (isLeapYear(year)) {
+                leapYears--;
+            }
+        }
+        return (year * 365L + (leapYears - DAYS_0000_TO_1970)) * CHRONON_OF_DAY;
+    }
+
+    /**
+     * Get the year for the given chronon time.
+     * <p/>
+     * This code is directly from the Joda library BadicChronology.java.<br/>
+     * The original authers are Stephen Colebourne, Brain S O'Neill and Guy Allard, and modified by JArod Wen on May 7th, 2012.
+     * 
+     * @param chrononTime
+     * @return
+     */
+    public int getYear(long chrononTime) {
+        // Get an initial estimate of the year, and the millis value that
+        // represents the start of that year. Then verify estimate and fix if
+        // necessary.
+
+        // Initial estimate uses values divided by two to avoid overflow.
+        long unitMillis = CHRONON_OF_YEAR / 2;
+        long i2 = (chrononTime >> 1) + (1970L * CHRONON_OF_YEAR) / 2;
+        if (i2 < 0) {
+            i2 = i2 - unitMillis + 1;
+        }
+        int year = (int) (i2 / unitMillis);
+
+        long yearStart = chrononizeBeginningOfYear(year);
+        long diff = chrononTime - yearStart;
+
+        if (diff < 0) {
+            year--;
+        } else if (diff >= CHRONON_OF_DAY * 365L) {
+            // One year may need to be added to fix estimate.
+            long oneYear;
+            if (isLeapYear(year)) {
+                oneYear = CHRONON_OF_DAY * 366L;
+            } else {
+                oneYear = CHRONON_OF_DAY * 365L;
+            }
+
+            yearStart += oneYear;
+
+            if (yearStart <= chrononTime) {
+                // Didn't go too far, so actually add one year.
+                year++;
+            }
+        }
+
+        return year;
+    }
+
+    /**
+     * Get the month of the year for the given chronon time and the year.
+     * <p/>
+     * This code is directly from the Joda library BasicGJChronology.java.<br/>
+     * The original authers are Stephen Colebourne, Brain S O'Neill and Guy Allard, and modified by JArod Wen on May 7th, 2012.
+     * <p/>
+     * 
+     * @param millis
+     * @param year
+     * @return
+     */
+    public int getMonthOfYear(long millis, int year) {
+        // Perform a binary search to get the month. To make it go even faster,
+        // compare using ints instead of longs. The number of milliseconds per
+        // year exceeds the limit of a 32-bit int's capacity, so divide by
+        // 1024. No precision is lost (except time of day) since the number of
+        // milliseconds per day contains 1024 as a factor. After the division,
+        // the instant isn't measured in milliseconds, but in units of
+        // (128/125)seconds.
+
+        int i = (int) ((millis - chrononizeBeginningOfYear(year)) >> 10);
+
+        // There are 86400000 milliseconds per day, but divided by 1024 is
+        // 84375. There are 84375 (128/125)seconds per day.
+
+        int leap = 0;
+
+        if (isLeapYear(year) == true) {
+            leap = 1; //Adding one day for the leap years
+        }
+
+        if (i < (181 + leap) * 84375) { /*Days before the end of June*/
+            if (i < (90 + leap) * 84375) { /*Days before the end of March*/
+                if (i < 31 * 84375) { /*Days before the end of January*/
+                    return 1;
+                } else if (i < (59 + leap) * 84375) { /*Days before the end of February*/
+                    return 2;
+                } else {
+                    return 3;
+                }
+            } else if (i < (120 + leap) * 84375) { /*Days before the end of April*/
+                return 4;
+            } else if (i < (151 + leap) * 84375) { /*Days before the end of May*/
+                return 5;
+            } else {
+                return 6;
+            }
+        } else if (i < (273 + leap) * 84375) { /*Days before the end of September*/
+            if (i < (212 + leap) * 84375) { /*Days before the end of July*/
+                return 7;
+            } else if (i < (243 + leap) * 84375) { /*Days before the end of August*/
+                return 8;
+            } else {
+                return 9;
+            }
+        } else if (i < (304 + leap) * 84375) { /*Days before the end of October*/
+            return 10;
+        } else if (i < (334 + leap) * 84375) { /*Days before the end of November*/
+            return 11;
+        } else {
+            return 12;
+        }
+    }
+
+    /**
+     * Get the day of the given month and year for the input chronon time.
+     * <p/>
+     * This function is directly from Joda Library BasicChronology.java.<br/>
+     * The original authers are Stephen Colebourne, Brain S O'Neill and Guy Allard, and modified by JArod Wen on May 7th, 2012.
+     * <p/>
+     * 
+     * @param millis
+     * @param year
+     * @param month
+     * @return
+     */
+    public int getDayOfMonthYear(long millis, int year, int month) {
+        long dateMillis = chrononizeBeginningOfYear(year);
+        dateMillis += DAYS_SINCE_MONTH_BEGIN_ORDI[month - 1] * CHRONON_OF_DAY;
+        if (isLeapYear(year) && month > 2) {
+            dateMillis += CHRONON_OF_DAY;
+        }
+        return (int) ((millis - dateMillis) / CHRONON_OF_DAY) + 1;
+    }
+
+    /**
+     * Get the hour of the day for the given chronon time.
+     * 
+     * @param millis
+     * @return
+     */
+    public int getHourOfDay(long millis) {
+        int hour = (int) ((millis % CHRONON_OF_DAY) / CHRONON_OF_HOUR);
+
+        if (millis < 0) {
+            if (millis % CHRONON_OF_HOUR == 0) {
+                if (hour < 0) {
+                    hour += 24;
+                }
+            } else {
+                hour += 23;
+            }
+        }
+
+        return hour;
+    }
+
+    /**
+     * Get the minute of the hour for the given chronon time.
+     * 
+     * @param millis
+     * @return
+     */
+    public int getMinOfHour(long millis) {
+        int min = (int) ((millis % CHRONON_OF_HOUR) / CHRONON_OF_MINUTE);
+        if (millis < 0) {
+            if (millis % CHRONON_OF_MINUTE == 0) {
+                if (min < 0) {
+                    min += 60;
+                }
+            } else {
+                min += 59;
+            }
+        }
+        return min;
+    }
+
+    /**
+     * Get the second of the minute for the given chronon time.
+     * 
+     * @param millis
+     * @return
+     */
+    public int getSecOfMin(long millis) {
+        int sec = (int) ((millis % CHRONON_OF_MINUTE) / CHRONON_OF_SECOND);
+        if (millis < 0) {
+            if (millis % CHRONON_OF_SECOND == 0) {
+                if (sec < 0) {
+                    sec += 60;
+                }
+            } else {
+                sec += 59;
+            }
+        }
+        return sec;
+    }
+
+    /**
+     * Get the millisecond of the second for the given chronon time.
+     * 
+     * @param millis
+     * @return
+     */
+    public int getMillisOfSec(long millis) {
+        int ms = (int) (millis % CHRONON_OF_SECOND);
+        if (millis < 0 && ms < 0) {
+            ms += 1000;
+        }
+        return ms;
+    }
+
+    public int getDurationMonth(int months) {
+        return (months % 12);
+    }
+
+    public int getDurationYear(int months) {
+        return (months / 12);
+    }
+
+    public int getDurationMillisecond(long milliseconds) {
+        return (int) (milliseconds % 1000);
+    }
+
+    public int getDurationSecond(long milliseconds) {
+        return (int) ((milliseconds % 60000) / 1000);
+    }
+
+    public int getDurationMinute(long milliseconds) {
+        return (int) ((milliseconds % 3600000) / 60000);
+    }
+
+    public int getDurationHour(long milliseconds) {
+        return (int) ((milliseconds % (86400000)) / 3600000);
+    }
+
+    public int getDurationDay(long milliseconds) {
+        return (int) (milliseconds / (86400000));
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICalendarSystem.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICalendarSystem.java
new file mode 100644
index 0000000..414a8fe
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICalendarSystem.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+public interface ICalendarSystem {
+
+    /**
+     * check whether the given time stamp is valid in the calendar system.
+     * 
+     * @param year
+     * @param month
+     * @param day
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public boolean validate(int year, int month, int day, int hour, int min, int sec, int millis, int timezone);
+
+    /**
+     * get the chronon time for the given time stamp in the calendar system.
+     * 
+     * @param year
+     * @param month
+     * @param day
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public long getChronon(int year, int month, int day, int hour, int min, int sec, int millis, int timezone);
+
+    /**
+     * get the chronon time for the given time in the calendar system
+     * 
+     * @param hour
+     * @param min
+     * @param sec
+     * @param millis
+     * @param timezone
+     * @return
+     */
+    public int getChronon(int hour, int min, int sec, int millis, int timezone);
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICharSequenceAccessor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICharSequenceAccessor.java
new file mode 100644
index 0000000..6b4e898
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/ICharSequenceAccessor.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+public interface ICharSequenceAccessor<T> {
+
+    public char getCharAt(int index);
+
+    public int getLength();
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/StringCharSequenceAccessor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/StringCharSequenceAccessor.java
new file mode 100644
index 0000000..6c02340
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/temporal/StringCharSequenceAccessor.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2009-2011 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.temporal;
+
+public class StringCharSequenceAccessor implements ICharSequenceAccessor<String> {
+
+    private String string;
+    private int offset;
+
+    @Override
+    public char getCharAt(int index) {
+        return string.charAt(index + offset);
+    }
+
+    public void reset(String obj, int offset) {
+        string = obj;
+        this.offset = offset;
+    }
+
+    @Override
+    public int getLength() {
+        return string.length() - offset;
+    }
+
+}
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 e1eaa7c..712843a 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
@@ -90,8 +90,9 @@
             case INT64:
             case DOUBLE:
             case DATETIME:
-            case DURATION:
                 return 8;
+            case DURATION:
+                return 12;
             case POINT:
                 return 16;
             case POINT3D:
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
index b7d295a..d057c88 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/collections/ListifyAggregateFunctionEvalFactory.java
@@ -11,8 +11,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ListifyAggregateFunctionEvalFactory implements ICopyAggregateFunctionFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
index cfbfa4e..057c274 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateDescriptor.java
@@ -29,7 +29,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SerializableAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
index e4c4931..31d9345 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateDescriptor.java
@@ -35,8 +35,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SerializableGlobalAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
index f5c9538..c12a9a6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateDescriptor.java
@@ -39,8 +39,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SerializableLocalAvgAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
index e689ab4..2b53d89 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateDescriptor.java
@@ -33,7 +33,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopySerializableAggregateFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SerializableSumAggregateDescriptor extends AbstractSerializableAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
index ecdd194..c82f1f0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/AvgAggregateDescriptor.java
@@ -39,9 +39,9 @@
 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.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
index 040e2d0..615f543 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/CountAggregateDescriptor.java
@@ -17,7 +17,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyAggregateFunctionFactory;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
index e86b2bc..837b357 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/GlobalAvgAggregateDescriptor.java
@@ -35,9 +35,9 @@
 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.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class GlobalAvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
index fa05d4b..d9173bd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/LocalAvgAggregateDescriptor.java
@@ -39,9 +39,9 @@
 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.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class LocalAvgAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
index e409910..3bc40b6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MaxAggregateDescriptor.java
@@ -31,8 +31,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 MaxAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
index af54c14..6a88a0d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/MinAggregateDescriptor.java
@@ -31,8 +31,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 MinAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
index 5e45432..fa611e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/std/SumAggregateDescriptor.java
@@ -33,8 +33,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SumAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
index 9d235e5..1a45f7d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/aggregates/stream/NonEmptyStreamAggregateDescriptor.java
@@ -16,7 +16,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class NonEmptyStreamAggregateDescriptor extends AbstractAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AccessibleByteArrayEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AccessibleByteArrayEval.java
index deb40eb..4e225d0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AccessibleByteArrayEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/AccessibleByteArrayEval.java
@@ -6,7 +6,7 @@
 
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AccessibleByteArrayEval implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
index 069b8a3..38983e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/ClosedRecordConstructorEvalFactory.java
@@ -10,8 +10,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ClosedRecordConstructorEvalFactory implements ICopyEvaluatorFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
index ed7b9bb..e20212c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/CreateMBREvalFactory.java
@@ -19,8 +19,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreateMBREvalFactory implements ICopyEvaluatorFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
index 613417d..3d35afd 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/EditDistanceEvaluator.java
@@ -14,8 +14,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 EditDistanceEvaluator implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
index 604bb68..af0a29c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/FieldAccessByIndexEvalFactory.java
@@ -19,8 +19,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
index b1d3cab..188135c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/GramTokensEvaluator.java
@@ -10,8 +10,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.BooleanSerializerDeserializer;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
index 696f74f..3f160d6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardCheckEvaluator.java
@@ -14,9 +14,9 @@
 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.primitive.IntegerPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SimilarityJaccardCheckEvaluator extends SimilarityJaccardEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
index 672fb39..9f5c9c8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardEvaluator.java
@@ -20,10 +20,10 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryHashFunction;
 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.primitive.IntegerPointable;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SimilarityJaccardEvaluator implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
index 3b527d9..7686cbe 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
@@ -21,8 +21,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
index f994448..a192c5d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedCheckEvaluator.java
@@ -4,7 +4,7 @@
 import edu.uci.ics.fuzzyjoin.similarity.SimilarityMetricJaccard;
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 public class SimilarityJaccardSortedCheckEvaluator extends SimilarityJaccardCheckEvaluator {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
index a27d8a4..3be0280 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/SimilarityJaccardSortedEvaluator.java
@@ -4,7 +4,7 @@
 import edu.uci.ics.fuzzyjoin.similarity.SimilarityMetricJaccard;
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 // Assumes that both arguments are sorted by the same ordering.
 public class SimilarityJaccardSortedEvaluator extends SimilarityJaccardEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
index e52757b..f0f36f5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/common/WordTokensEvaluator.java
@@ -10,8 +10,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IToken;
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 6e1cea4..18fc2d7 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
@@ -21,7 +21,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.FloatSerializerDeserializer;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
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 c971929..ed77276 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
@@ -9,7 +9,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class ComparisonEvalFactory implements ICopyEvaluatorFactory {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
index 12a1b9a..8b9f665 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ABooleanConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -19,8 +33,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ABooleanConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
index 2eb9c20..3d22c11 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ACircleConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -19,8 +33,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ACircleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
index 25b2f84..ba48742 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -8,6 +22,9 @@
 import edu.uci.ics.asterix.om.base.ADate;
 import edu.uci.ics.asterix.om.base.AMutableDate;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
+import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -18,8 +35,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ADateConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
@@ -28,6 +45,9 @@
     public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "date", 1);
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private final static ByteArrayCharSequenceAccessor charAccessor = new ByteArrayCharSequenceAccessor();
+
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ADateConstructorDescriptor();
@@ -47,12 +67,8 @@
 
                     private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
                     private ICopyEvaluator eval = args[0].createEvaluator(outInput);
-                    private int offset;
-                    private short year, month, day, hour, minute, value;
-                    private byte timezonePart = 0;
-                    private boolean positive = true;
                     private String errorMessage = "This can not be an instance of date";
-                    private AMutableDate aDate = new AMutableDate(0, 0, 0, 0);
+                    private AMutableDate aDate = new AMutableDate(0);
                     @SuppressWarnings("unchecked")
                     private ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATE);
@@ -68,73 +84,30 @@
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
                             if (serString[0] == SER_STRING_TYPE_TAG) {
-                                offset = 3;
 
-                                if (serString[offset] == '-') {
-                                    offset++;
-                                    positive = false;
+                                charAccessor.reset(serString, 3, 0);
+                                long chrononTimeInMs = ADateAndTimeParser.parseDatePart(charAccessor, true);
+
+                                short temp = 0;
+                                if (chrononTimeInMs < 0
+                                        && chrononTimeInMs % GregorianCalendarSystem.CHRONON_OF_DAY != 0) {
+                                    temp = 1;
                                 }
 
-                                if (serString[offset + 4] != '-' || serString[offset + 7] != '-')
-                                    throw new AlgebricksException(errorMessage);
+                                aDate.setValue((int) (chrononTimeInMs / GregorianCalendarSystem.CHRONON_OF_DAY) - temp);
 
-                                year = getValue(serString, offset, 4);
-                                month = getValue(serString, offset + 5, 2);
-                                day = getValue(serString, offset + 8, 2);
-
-                                if (year < 0 || year > 9999 || month < 0 || month > 12 || day < 0 || day > 31)
-                                    throw new AlgebricksException(errorMessage);
-
-                                offset += 10;
-
-                                if (outInput.getLength() > offset) {
-                                    if (serString[offset] == 'Z')
-                                        timezonePart = 0;
-                                    else {
-                                        if ((serString[offset] != '+' && serString[offset] != '-')
-                                                || (serString[offset + 3] != ':'))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        hour = getValue(serString, offset + 1, 2);
-                                        minute = getValue(serString, offset + 4, 2);
-
-                                        if (hour < 0 || hour > 24 || (hour == 24 && minute != 0)
-                                                || (minute != 0 && minute != 15 && minute != 30 && minute != 45))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        if (serString[offset] == '-')
-                                            timezonePart = (byte) -((hour * 4) + minute / 15);
-                                        else
-                                            timezonePart = (byte) ((hour * 4) + minute / 15);
-                                    }
-
-                                }
-
-                                if (!positive)
-                                    year *= -1;
-
-                                aDate.setValue(year, month, day, timezonePart);
                                 dateSerde.serialize(aDate, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
-                            else
+                            } else {
                                 throw new AlgebricksException(errorMessage);
+                            }
                         } catch (IOException e1) {
                             throw new AlgebricksException(errorMessage);
+                        } catch (Exception e2) {
+                            throw new AlgebricksException(e2);
                         }
                     }
-
-                    private short getValue(byte[] b, int offset, int numberOfDigits) throws AlgebricksException {
-                        value = 0;
-                        for (int i = 0; i < numberOfDigits; i++) {
-                            if ((b[offset] >= '0' && b[offset] <= '9'))
-                                value = (short) (value * 10 + b[offset++] - '0');
-                            else
-                                throw new AlgebricksException(errorMessage);
-
-                        }
-                        return value;
-                    }
                 };
             }
         };
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
index c37d646..49a4734 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADateTimeConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -8,6 +22,8 @@
 import edu.uci.ics.asterix.om.base.ADateTime;
 import edu.uci.ics.asterix.om.base.AMutableDateTime;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -18,8 +34,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ADateTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
@@ -28,6 +44,9 @@
     public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "datetime", 1);
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private final static ByteArrayCharSequenceAccessor charAccessor = new ByteArrayCharSequenceAccessor();
+
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ADateTimeConstructorDescriptor();
@@ -47,12 +66,8 @@
 
                     private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
                     private ICopyEvaluator eval = args[0].createEvaluator(outInput);
-                    private int offset;
-                    private short hour, minute, second, msecond, year, month, day, timezoneHour, timezoneMinute, value;
-                    private byte timezonePart = 0;
-                    private boolean positive = true;
                     private String errorMessage = "This can not be an instance of datetime";
-                    private AMutableDateTime aDateTime = new AMutableDateTime(0, 0, 0, 0, 0, 0, 0, 0, 0);
+                    private AMutableDateTime aDateTime = new AMutableDateTime(0L);
                     @SuppressWarnings("unchecked")
                     private ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATETIME);
@@ -68,100 +83,39 @@
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
                             if (serString[0] == SER_STRING_TYPE_TAG) {
+                                charAccessor.reset(serString, 3, 0);
 
-                                offset = 3;
-                                if (serString[offset] == '-') {
-                                    offset++;
-                                    positive = false;
+                                // +1 if it is negative (-)
+                                short timeOffset = (short) ((charAccessor.getCharAt(0) == '-') ? 1 : 0);
+
+                                if (charAccessor.getCharAt(timeOffset + 10) != 'T'
+                                        && charAccessor.getCharAt(timeOffset + 8) != 'T') {
+                                    throw new AlgebricksException(errorMessage + ": missing T");
                                 }
 
-                                if (serString[offset + 4] != '-' || serString[offset + 7] != '-')
-                                    throw new AlgebricksException(errorMessage);
+                                // if extended form 11, else 9
+                                timeOffset += (charAccessor.getCharAt(timeOffset + 13) == ':') ? (short) (11)
+                                        : (short) (9);
 
-                                year = getValue(serString, offset, 4);
-                                month = getValue(serString, offset + 5, 2);
-                                day = getValue(serString, offset + 8, 2);
+                                long chrononTimeInMs = ADateAndTimeParser.parseDatePart(charAccessor, false);
 
-                                if (year < 0 || year > 9999 || month < 0 || month > 12 || day < 0 || day > 31)
-                                    throw new AlgebricksException(errorMessage);
+                                charAccessor.reset(serString, 3, timeOffset);
 
-                                if (!positive)
-                                    year *= -1;
+                                chrononTimeInMs += ADateAndTimeParser.parseTimePart(charAccessor);
 
-                                if (serString[offset + 10] != 'T')
-                                    throw new AlgebricksException(errorMessage);
-
-                                offset += 11;
-
-                                if (serString[offset + 2] != ':' || serString[offset + 5] != ':')
-                                    throw new AlgebricksException(errorMessage);
-
-                                hour = getValue(serString, offset, 2);
-                                minute = getValue(serString, offset + 3, 2);
-                                second = getValue(serString, offset + 6, 2);
-
-                                msecond = 0;
-                                if (serString[offset + 8] == ':') {
-                                    msecond = getValue(serString, offset + 9, 3);
-                                    if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                                            || msecond < 0 || msecond > 999
-                                            || (hour == 24 && (minute != 0 || second != 0 || msecond != 0)))
-                                        throw new AlgebricksException(errorMessage);
-                                    offset += 12;
-                                } else {
-                                    if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                                            || (hour == 24 && (minute != 0 || second != 0)))
-                                        throw new AlgebricksException(errorMessage);
-                                    offset += 8;
-                                }
-
-                                if (outInput.getLength() > offset) {
-                                    if (serString[offset] == 'Z')
-                                        timezonePart = 0;
-                                    else {
-                                        if ((serString[offset] != '+' && serString[offset] != '-')
-                                                || (serString[offset + 3] != ':'))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        timezoneHour = getValue(serString, offset + 1, 2);
-                                        timezoneMinute = getValue(serString, offset + 4, 2);
-
-                                        if (timezoneHour < 0
-                                                || timezoneHour > 24
-                                                || (timezoneHour == 24 && timezoneMinute != 0)
-                                                || (timezoneMinute != 0 && timezoneMinute != 15 && timezoneMinute != 30 && timezoneMinute != 45))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        if (serString[offset] == '-')
-                                            timezonePart = (byte) -((timezoneHour * 4) + timezoneMinute / 15);
-                                        else
-                                            timezonePart = (byte) ((timezoneHour * 4) + timezoneMinute / 15);
-                                    }
-
-                                }
-
-                                aDateTime.setValue(year, month, day, hour, minute, second, msecond, 0, timezonePart);
+                                aDateTime.setValue(chrononTimeInMs);
                                 datetimeSerde.serialize(aDateTime, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
-                            else
+                            } else {
                                 throw new AlgebricksException(errorMessage);
+                            }
                         } catch (IOException e1) {
                             throw new AlgebricksException(errorMessage);
+                        } catch (Exception e2) {
+                            throw new AlgebricksException(e2);
                         }
                     }
-
-                    private short getValue(byte[] b, int offset, int numberOfDigits) throws AlgebricksException {
-                        value = 0;
-                        for (int i = 0; i < numberOfDigits; i++) {
-                            if ((b[offset] >= '0' && b[offset] <= '9'))
-                                value = (short) (value * 10 + b[offset++] - '0');
-                            else
-                                throw new AlgebricksException(errorMessage);
-
-                        }
-                        return value;
-                    }
                 };
             }
         };
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
index f0aed55..8a837e9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ADoubleConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -20,8 +34,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ADoubleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
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 c2215ff..977bee1 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
@@ -1,13 +1,28 @@
+/*
+ * Copyright 2009-2011 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 java.io.IOException;
 
 import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.ADuration;
 import edu.uci.ics.asterix.om.base.AMutableDuration;
 import edu.uci.ics.asterix.om.base.ANull;
+import edu.uci.ics.asterix.om.base.temporal.ADurationParser;
+import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -18,8 +33,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ADurationConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
@@ -28,6 +43,9 @@
     public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "duration", 1);
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private final static ByteArrayCharSequenceAccessor charAccessor = new ByteArrayCharSequenceAccessor();
+
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ADurationConstructorDescriptor();
@@ -47,10 +65,6 @@
 
                     private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
                     private ICopyEvaluator eval = args[0].createEvaluator(outInput);
-                    private int offset;
-                    private int value = 0, hour = 0, minute = 0, second = 0, year = 0, month = 0, day = 0;
-                    private boolean isYear = true, isMonth = true, isDay = true, isHour = true, isMinute = true,
-                            isSecond = true, isTime = false, timeItem = true, positive = true;
                     private String errorMessage = "This can not be an instance of duration";
                     private AMutableDuration aDuration = new AMutableDuration(0, 0);
                     @SuppressWarnings("unchecked")
@@ -67,120 +81,21 @@
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
+
                             if (serString[0] == SER_STRING_TYPE_TAG) {
-                                offset = 3;
-                                if (serString[offset] == '-') {
-                                    offset++;
-                                    positive = false;
-                                }
-                                if (serString[offset++] != 'D')
-                                    throw new AlgebricksException(errorMessage);
 
-                                for (; offset < outInput.getLength(); offset++) {
-                                    if (serString[offset] >= '0' && serString[offset] <= '9')
-                                        value = value * 10 + serString[offset] - '0';
-                                    else {
-                                        switch (serString[offset]) {
-                                            case 'Y':
-                                                if (isYear) {
-                                                    year = value;
-                                                    isYear = false;
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
-                                            case 'M':
-                                                if (!isTime) {
-                                                    if (isMonth) {
-                                                        if (value < 0 || value > 11)
-                                                            throw new AlgebricksException(errorMessage);
-                                                        else {
-                                                            month = value;
-                                                            isMonth = false;
-                                                        }
-                                                    } else
-                                                        throw new AlgebricksException(errorMessage);
-                                                } else if (isMinute) {
-                                                    if (value < 0 || value > 59)
-                                                        throw new AlgebricksException(errorMessage);
-                                                    else {
-                                                        minute = value;
-                                                        isMinute = false;
-                                                        timeItem = false;
-                                                    }
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
-                                            case 'D':
-                                                if (isDay) {
-                                                    if (value < 0 || value > 30)
-                                                        throw new AlgebricksException(errorMessage);
-                                                    else {
-                                                        day = value;
-                                                        isDay = false;
-                                                    }
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
-                                            case 'T':
-                                                if (!isTime) {
-                                                    isTime = true;
-                                                    timeItem = true;
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
+                                charAccessor.reset(serString, 3, 0);
 
-                                            case 'H':
-                                                if (isHour) {
-                                                    if (value < 0 || value > 23)
-                                                        throw new AlgebricksException(errorMessage);
-                                                    else {
-                                                        hour = value;
-                                                        isHour = false;
-                                                        timeItem = false;
-                                                    }
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
-                                            case 'S':
-                                                if (isSecond) {
-                                                    if (value < 0 || value > 59)
-                                                        throw new AlgebricksException(errorMessage);
-                                                    else {
-                                                        second = value;
-                                                        isSecond = false;
-                                                        timeItem = false;
-                                                    }
-                                                } else
-                                                    throw new AlgebricksException(errorMessage);
-                                                break;
-                                            default:
-                                                throw new AlgebricksException(errorMessage);
+                                ADurationParser.parse(charAccessor, aDuration);
 
-                                        }
-                                        value = 0;
-                                    }
-                                }
-
-                                if (isTime && timeItem)
-                                    throw new AlgebricksException(errorMessage);
-
-                                if (isYear && isMonth && isDay && !isTime)
-                                    throw new AlgebricksException(errorMessage);
-
-                                if (positive)
-                                    aDuration.setValue(year * 12 + month, day * 24 * 3600 + 3600 * hour + 60 * minute
-                                            + second);
-                                else
-                                    aDuration.setValue(-1 * (year * 12 + month), -1
-                                            * (day * 24 * 3600 + 3600 * hour + 60 * minute + second));
                                 durationSerde.serialize(aDuration, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
-                            else
+                            } else {
                                 throw new AlgebricksException(errorMessage);
-
-                        } catch (IOException e1) {
-                            throw new AlgebricksException(errorMessage);
+                            }
+                        } catch (Exception e1) {
+                            throw new AlgebricksException(e1);
                         }
                     }
                 };
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
index 8737d7b..df5ed8c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AFloatConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -20,8 +34,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AFloatConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
index b282476..41ac615 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AInt16ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
index 3368f41..1327b30 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt32ConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AInt32ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
index 11242f6..de480fa 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt64ConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AInt64ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
index 4bacb74..8721116 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AInt8ConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AInt8ConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
index cb90362..84e7295 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -19,8 +33,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
index e9e5353..89ea420 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
index 9b6e851..4ae4725 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
index f79a403..dc3234e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -18,8 +32,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 APointConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
index 8ad7fa9..b856bff 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -17,8 +31,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 APolygonConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
index e8a39ca..9d2385f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -19,8 +33,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ARectangleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
index d443a5e..70b35e3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -16,8 +30,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AStringConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
index 8a7ac44..48c06b0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009-2011 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;
@@ -8,6 +22,8 @@
 import edu.uci.ics.asterix.om.base.AMutableTime;
 import edu.uci.ics.asterix.om.base.ANull;
 import edu.uci.ics.asterix.om.base.ATime;
+import edu.uci.ics.asterix.om.base.temporal.ByteArrayCharSequenceAccessor;
+import edu.uci.ics.asterix.om.base.temporal.ADateAndTimeParser;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
 import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
 import edu.uci.ics.asterix.om.types.ATypeTag;
@@ -18,8 +34,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
@@ -28,6 +44,7 @@
     public final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "time", 1);
     private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+    private final static ByteArrayCharSequenceAccessor charAccessor = new ByteArrayCharSequenceAccessor();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         public IFunctionDescriptor createFunctionDescriptor() {
@@ -48,11 +65,8 @@
 
                     private ArrayBackedValueStorage outInput = new ArrayBackedValueStorage();
                     private ICopyEvaluator eval = args[0].createEvaluator(outInput);
-                    private int offset;
-                    private short hour, minute, second, msecond, timezoneHour, timezoneMinute, value;
-                    private byte timezonePart = 0;
                     private String errorMessage = "This can not be an instance of time";
-                    private AMutableTime aTime = new AMutableTime(0, 0, 0, 0, 0, 0);
+                    private AMutableTime aTime = new AMutableTime(0);
                     @SuppressWarnings("unchecked")
                     private ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ATIME);
@@ -68,75 +82,23 @@
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
                             if (serString[0] == SER_STRING_TYPE_TAG) {
-                                offset = 3;
-                                if (serString[offset + 2] != ':' || serString[offset + 5] != ':')
-                                    throw new AlgebricksException(errorMessage);
+                                charAccessor.reset(serString, 3, 0);
+                                int chrononTimeInMs = ADateAndTimeParser.parseTimePart(charAccessor);
 
-                                hour = getValue(serString, offset, 2);
-                                minute = getValue(serString, offset + 3, 2);
-                                second = getValue(serString, offset + 6, 2);
-                                msecond = 0;
-
-                                if (serString[offset + 8] == ':') {
-                                    msecond = getValue(serString, offset + 9, 3);
-                                    if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                                            || msecond < 0 || msecond > 999
-                                            || (hour == 24 && (minute != 0 || second != 0 || msecond != 0)))
-                                        throw new AlgebricksException(errorMessage);
-                                    offset += 12;
-                                } else {
-                                    if (hour < 0 || hour > 24 || minute < 0 || minute > 59 || second < 0 || second > 59
-                                            || (hour == 24 && (minute != 0 || second != 0)))
-                                        throw new AlgebricksException(errorMessage);
-                                    offset += 8;
-                                }
-
-                                if (outInput.getLength() > offset) {
-                                    if (serString[offset] == 'Z')
-                                        timezonePart = 0;
-                                    else {
-                                        if ((serString[offset] != '+' && serString[offset] != '-')
-                                                || (serString[offset + 3] != ':'))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        timezoneHour = getValue(serString, offset + 1, 2);
-                                        timezoneMinute = getValue(serString, offset + 4, 2);
-
-                                        if (timezoneHour < 0
-                                                || timezoneHour > 24
-                                                || (timezoneHour == 24 && timezoneMinute != 0)
-                                                || (timezoneMinute != 0 && timezoneMinute != 15 && timezoneMinute != 30 && timezoneMinute != 45))
-                                            throw new AlgebricksException(errorMessage);
-
-                                        if (serString[offset] == '-')
-                                            timezonePart = (byte) -((timezoneHour * 4) + timezoneMinute / 15);
-                                        else
-                                            timezonePart = (byte) ((timezoneHour * 4) + timezoneMinute / 15);
-                                    }
-                                }
-
-                                aTime.setValue(hour, minute, second, msecond, 0, timezonePart);
+                                aTime.setValue(chrononTimeInMs);
                                 timeSerde.serialize(aTime, out);
 
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
-                            else
+                            } else {
                                 throw new AlgebricksException(errorMessage);
+                            }
                         } catch (IOException e1) {
                             throw new AlgebricksException(errorMessage);
+                        } catch (Exception e2) {
+                            throw new AlgebricksException(e2);
                         }
                     }
-
-                    private short getValue(byte[] b, int offset, int numberOfDigits) throws AlgebricksException {
-                        value = 0;
-                        for (int i = 0; i < numberOfDigits; i++) {
-                            if ((b[offset] >= '0' && b[offset] <= '9'))
-                                value = (short) (value * 10 + b[offset++] - '0');
-                            else
-                                throw new AlgebricksException(errorMessage);
-                        }
-                        return value;
-                    }
                 };
             }
         };
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
index c9834ac..1a4b3e0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
@@ -10,7 +10,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.util.Arrays;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
index 96a2876..b2d420b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractNumericArithmeticEval.java
@@ -26,8 +26,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 
 @SuppressWarnings("serial")
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
index a0befd8..1a59340 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
@@ -15,7 +15,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
index 1920db4..eed3a24 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractStringContainsEval.java
@@ -10,7 +10,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public abstract class AbstractStringContainsEval implements ICopyEvaluator {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
index e0f8fc9..d8637ad 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
@@ -10,7 +10,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.util.Arrays;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
index e82d30f..7179cbf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
@@ -11,7 +11,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
index 3d05651..e9dab9d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AndDescriptor.java
@@ -16,8 +16,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AndDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
index e4ada73..175db39 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
@@ -21,8 +21,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
index aad2c27..4182824 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CastRecordDescriptor.java
@@ -16,8 +16,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CastRecordDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
index 7e27463..f23df3a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
@@ -17,8 +17,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
 import java.io.DataOutput;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
index cf1abc6..5e558be 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/ContainsDescriptor.java
@@ -10,8 +10,8 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
 
 public class ContainsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
     private static final long serialVersionUID = 1L;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
index 1e72adf..184d974 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedGramTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.HashedUTF8NGramTokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.ITokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
index 4462098..7bfbe49 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CountHashedWordTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.DelimitedUTF8StringBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.HashedUTF8WordTokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
index dc2c1e1..45ea698 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateCircleDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreateCircleDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
index 370ed56..f234dc4 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateLineDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreateLineDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
index 58cd6a8..6cbcba5 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
@@ -17,8 +17,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreatePointDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
index f967a69..26b3ad9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
@@ -12,8 +12,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreatePolygonDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
index 44d6881..01c33df 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/CreateRectangleDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 CreateRectangleDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
index c261f1f..fc65b8e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceCheckDescriptor.java
@@ -19,8 +19,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
index 8a7e356..411e809 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 public class EditDistanceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
index f5bfc4f..7ebeee6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceListIsFilterable.java
@@ -18,8 +18,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
index 443f792..8288456 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EditDistanceStringIsFilterable.java
@@ -16,9 +16,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.BooleanSerializerDeserializer;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
index d1f3d25..4c0c704 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EmbedTypeDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class EmbedTypeDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
index 0ef6375..bcf85fe 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/EndsWithDescriptor.java
@@ -10,8 +10,8 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
 
 public class EndsWithDescriptor extends AbstractScalarFunctionDynamicDescriptor {
     private static final long serialVersionUID = 1L;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
index b6e376b..bdc0dff 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/FieldAccessByNameDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 FieldAccessByNameDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
index e098ef9..cbc61cf 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GetItemDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
index b01c29c..558ae7e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/GramTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.ITokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.UTF8NGramTokenFactory;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
index 097df8c..04088a2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedGramTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.HashedUTF8NGramTokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.ITokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
index 4e44523..dcd5f70 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/HashedWordTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.DelimitedUTF8StringBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.HashedUTF8WordTokenFactory;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
index b2ac3ca..000c387 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/InjectFailureDescriptor.java
@@ -13,8 +13,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 InjectFailureDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
index 813fc41..4f3a83c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/IsNullDescriptor.java
@@ -14,8 +14,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 IsNullDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
index e09035e..2b354e0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LenDescriptor.java
@@ -21,8 +21,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 LenDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
index a3bd5bd..2d7d4ae 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/LikeDescriptor.java
@@ -26,9 +26,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
index a3f78e4..dc7dcd2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NotDescriptor.java
@@ -18,8 +18,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NotDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
index 662e777..01cc999 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericAbsDescriptor.java
@@ -35,8 +35,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericAbsDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
index 2029426..9c52846 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericCeilingDescriptor.java
@@ -35,8 +35,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericCeilingDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
index d30ebb5..6626a12 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericFloorDescriptor.java
@@ -35,8 +35,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericFloorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
index c92d75f..a38c4e2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericModuloDescriptor.java
@@ -44,8 +44,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
index d43cdd0..588877c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundDescriptor.java
@@ -35,8 +35,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericRoundDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
index f43567c..43bed94 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEven2Descriptor.java
@@ -22,8 +22,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import java.io.DataOutput;
 import java.math.BigDecimal;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
index 9499bb3..af61a52 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericRoundHalfToEvenDescriptor.java
@@ -22,8 +22,8 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import java.io.DataOutput;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
index 9abbf47..1eb1119 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericSubtractDescriptor.java
@@ -30,8 +30,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericSubtractDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
index 9e3b188..cabd44b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/NumericUnaryMinusDescriptor.java
@@ -30,8 +30,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 NumericUnaryMinusDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
index 37d6ce0..59689d1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OpenRecordConstructorDescriptor.java
@@ -14,8 +14,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 OpenRecordConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
index a54ec54..9fc30f6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrDescriptor.java
@@ -16,8 +16,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 OrDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
index 520b386..496c524 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/OrderedListConstructorDescriptor.java
@@ -14,8 +14,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 OrderedListConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
index 25cbf74..61f4c21 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenDescriptor.java
@@ -19,8 +19,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
index 927ade5..9874991 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/PrefixLenJaccardDescriptor.java
@@ -18,8 +18,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
index 01b00a0..f225db7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/RegExpDescriptor.java
@@ -25,9 +25,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
index ec21b96..3fe3a29 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
@@ -27,8 +27,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
index 4881e2a..c50af79 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardCheckDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 public class SimilarityJaccardCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
index 95d994f..77d9dba 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 public class SimilarityJaccardDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
index 24f012e..501c32f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixCheckDescriptor.java
@@ -20,8 +20,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 public class SimilarityJaccardPrefixCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
index 54d4280..1994de9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardPrefixDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 public class SimilarityJaccardPrefixDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
index 23b7a5d..7e28a0a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedCheckDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 // Assumes that both arguments are sorted by the same ordering.
 public class SimilarityJaccardSortedCheckDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
index db944d4..1877ea6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SimilarityJaccardSortedDescriptor.java
@@ -9,7 +9,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 
 // Assumes that both arguments are sorted by the same ordering.
 public class SimilarityJaccardSortedDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
index f35adee..c641f1a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialAreaDescriptor.java
@@ -21,8 +21,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SpatialAreaDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
index c2a4d66..1426f91 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialCellDescriptor.java
@@ -23,8 +23,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SpatialCellDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
index 22132cc..d83f62e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialDistanceDescriptor.java
@@ -18,8 +18,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SpatialDistanceDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
index b519a23..25a03fe 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
@@ -29,8 +29,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SpatialIntersectDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
index cd8079d..015a94b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StartsWithDescriptor.java
@@ -10,8 +10,8 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
 
 public class StartsWithDescriptor extends AbstractScalarFunctionDynamicDescriptor {
     private static final long serialVersionUID = 1L;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
index 73d2ac9..1c2cee7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
@@ -16,9 +16,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
 import java.io.DataOutput;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
index 7d5bdab..2c2ad2e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEndWithDescrtiptor.java
@@ -12,9 +12,10 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+
 import java.io.DataOutput;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
index 5417e22..2f6237f 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringEqualDescriptor.java
@@ -8,9 +8,10 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+
 import java.io.DataOutput;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
index 83784bb..5bbc9df3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
@@ -16,9 +16,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
 import java.io.DataOutput;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
index 1952da2..8f44d7d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLengthDescriptor.java
@@ -15,9 +15,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
index f576cf4..25a966e 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringLowerCaseDescriptor.java
@@ -13,9 +13,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.util.StringUtils;
 import java.io.DataOutput;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
index e9e016f..a021961 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesDescriptor.java
@@ -22,9 +22,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
index 912a014..df5e587 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringMatchesWithFlagDescriptor.java
@@ -26,9 +26,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
index 15c612e..ecc8b34 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceDescriptor.java
@@ -22,9 +22,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
index aedad20..84b6ca3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringReplaceWithFlagsDescriptor.java
@@ -22,9 +22,9 @@
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparator;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
index 9ecdee9..18009d2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringStartWithDescrtiptor.java
@@ -10,9 +10,9 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 
 /**
  * @author Xiaoyu Ma
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
index 3c60e28..45f5efc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/StringToCodePointDescriptor.java
@@ -21,9 +21,9 @@
 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.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 /**
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
index ebbfe80..eff1ec9 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/Substring2Descriptor.java
@@ -12,9 +12,9 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
index 567526d..8e88ac8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringAfterDescriptor.java
@@ -9,9 +9,9 @@
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import java.io.DataOutput;
 import java.io.IOException;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
index fb496a1..081941a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringBeforeDescriptor.java
@@ -12,9 +12,9 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class SubstringBeforeDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
index 5d3007f..ad132fb 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SubstringDescriptor.java
@@ -12,9 +12,9 @@
 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.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
index 4a33010..7f95051 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/SwitchCaseDescriptor.java
@@ -11,8 +11,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 SwitchCaseDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
index 39149ac..c38a68c 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/UnorderedListConstructorDescriptor.java
@@ -14,8 +14,8 @@
 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.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 UnorderedListConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
index 8f8c5f3..5e9065b 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/WordTokensDescriptor.java
@@ -11,7 +11,7 @@
 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.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.DelimitedUTF8StringBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
 import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.ITokenFactory;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
index e6da3ac..9f7955a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/functions/YearDescriptor.java
@@ -19,9 +19,9 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class YearDescriptor extends AbstractScalarFunctionDynamicDescriptor {
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 e9f1ac5..86a02af 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
@@ -191,7 +191,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.evaluators.ConstantEvalFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.INullWriterFactory;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.DoubleParserFactory;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.FloatParserFactory;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
index 43556f2..c8511d2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmSchemafullRecordParserFactory.java
@@ -59,10 +59,10 @@
 import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
 import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
index 573eb78..96540c3 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/AdmTupleParser.java
@@ -42,10 +42,10 @@
 import edu.uci.ics.hyracks.api.comm.IFrameWriter;
 import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 
 public class AdmTupleParser extends AbstractTupleParser  {
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
index db46578..abd2ade 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/DelimitedDataTupleParser.java
@@ -16,10 +16,10 @@
 import edu.uci.ics.hyracks.api.comm.IFrameWriter;
 import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
index 0c93d86..cfe94ef 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/operators/file/NtDelimitedDataTupleParserFactory.java
@@ -20,10 +20,10 @@
 import edu.uci.ics.hyracks.api.context.IHyracksTaskContext;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.ArrayTupleBuilder;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameTupleAppender;
 import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParser;
 import edu.uci.ics.hyracks.dataflow.common.data.parsers.IValueParserFactory;
 import edu.uci.ics.hyracks.dataflow.std.file.ITupleParser;
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
index 50c8b37..8ef2ef0 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/pointables/cast/ARecordCaster.java
@@ -41,7 +41,7 @@
 import edu.uci.ics.hyracks.data.std.accessors.PointableBinaryComparatorFactory;
 import edu.uci.ics.hyracks.data.std.api.IValueReference;
 import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * This class is to do the runtime type cast for a record. It is ONLY visible to
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
index f4bc68d..6c9f4dc 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/runningaggregates/std/TidRunningAggregateDescriptor.java
@@ -17,7 +17,7 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyRunningAggregateFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
 import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class TidRunningAggregateDescriptor extends AbstractRunningAggregateFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
index 03d2677..a81172d 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/RangeDescriptor.java
@@ -17,8 +17,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
index cfac382..7963b00 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
@@ -23,8 +23,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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 ScanCollectionDescriptor extends AbstractUnnestingFunctionDynamicDescriptor {
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
index 8aee5cf..8ebfd15 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
@@ -23,8 +23,8 @@
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunction;
 import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyUnnestingFunctionFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.data.accessors.IDataOutputProvider;
+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;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
 
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java
index 5aecd08..968c3f2 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/util/ResettableByteArrayOutputStream.java
@@ -1,6 +1,6 @@
 package edu.uci.ics.asterix.runtime.util;
 
-import edu.uci.ics.hyracks.dataflow.common.comm.io.ByteArrayAccessibleOutputStream;
+import edu.uci.ics.hyracks.data.std.util.ByteArrayAccessibleOutputStream;
 
 /**
  * This class extends ByteArrayAccessibleOutputStream to allow reset to a given