ASTERIXDB-1281 - Interval format update to AQL and ADM

The new interval format takes a more generic approach to representing intervals.
Here is an example for a date interval:

interval(date("2012-01-01”), date(”2013-04-01”))

Note that the interval type is defined by the arguments to the interval expression.
Currently only date, time, and datetime types are supported for intervals. The new
format is used for ADM and AQL.

In addition to the format change, the internal byte structure of an interval has been
updated. The format looks like the following:

byte tag, T start, T end (where T is a date, time or datetime type)

Note how the tag has been moved to the front. Also with the new sturcture, an
interval is variable length, not fixed length as before.

Change-Id: I009c71b7a445d141e228ba15d56d0b6cf3c8a3f5
Reviewed-on: https://asterix-gerrit.ics.uci.edu/602
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterix-app/data/temporal/simpletemp_30.json b/asterix-app/data/temporal/simpletemp_30.json
index dcc9d8c..fe3406a 100644
--- a/asterix-app/data/temporal/simpletemp_30.json
+++ b/asterix-app/data/temporal/simpletemp_30.json
@@ -1,3 +1,3 @@
-{ "date": date("4619-11-23"), "time": time("14:29:36.786Z"), "datetime": datetime("2749-01-27T17:27:30.020Z"), "duration": duration("-P474133Y7M854630DT4H40M6.45S"), "year-month-duration": year-month-duration("P193989Y3M"), "day-time-duration": day-time-duration("P4477686DT4H49M31.87S"), "date-interval": interval-date("-9537-08-04, 9656-06-03"), "time-interval": interval-time("12:04:45.689Z, 12:41:59.002Z"), "datetime-interval": interval-datetime("-2640-10-11T17:32:15.675Z, 4104-02-01T05:59:11.902Z") }
-{ "date": date("-9971-09-24"), "time": time("11:38:17.154Z"), "datetime": datetime("1259-11-13T09:49:11.852Z"), "duration": duration("P473653Y9M4566143DT10H20M53.61S"), "year-month-duration": year-month-duration("P148233Y10M"), "day-time-duration": day-time-duration("-P7236357DT2H56M56.164S"), "date-interval": interval-date("-0255-09-06, 4925-05-03"), "time-interval": interval-time("12:10:45.169Z, 15:37:48.736Z"), "datetime-interval": interval-datetime("0534-12-08T08:20:31.487Z, 6778-02-16T22:40:21.653Z") }
-{ "date": date("7986-11-25"), "time": time("12:49:39.736Z"), "datetime": datetime("-8337-01-30T15:23:07.598Z"), "duration": duration("-P184484Y7M2241423DT10H42M49.500S"), "year-month-duration": year-month-duration("-P546031Y3M"), "day-time-duration": day-time-duration("P2623386DT10H32M31.983S"), "date-interval": interval-date("-4514-05-24, 3337-08-26"), "time-interval": interval-time("04:16:42.321Z, 12:22:56.816Z"), "datetime-interval": interval-datetime("2129-12-12T13:18:35.758Z, 8647-07-01T13:10:19.691Z") }
+{ "date": date("4619-11-23"), "time": time("14:29:36.786Z"), "datetime": datetime("2749-01-27T17:27:30.020Z"), "duration": duration("-P474133Y7M854630DT4H40M6.45S"), "year-month-duration": year-month-duration("P193989Y3M"), "day-time-duration": day-time-duration("P4477686DT4H49M31.87S"), "date-interval": interval(date("-9537-08-04"), date("9656-06-03")), "time-interval": interval(time("12:04:45.689Z"), time("12:41:59.002Z")), "datetime-interval": interval(datetime("-2640-10-11T17:32:15.675Z"), datetime("4104-02-01T05:59:11.902Z")) }
+{ "date": date("-9971-09-24"), "time": time("11:38:17.154Z"), "datetime": datetime("1259-11-13T09:49:11.852Z"), "duration": duration("P473653Y9M4566143DT10H20M53.61S"), "year-month-duration": year-month-duration("P148233Y10M"), "day-time-duration": day-time-duration("-P7236357DT2H56M56.164S"), "date-interval": interval(date("-0255-09-06"), date("4925-05-03")), "time-interval": interval(time("12:10:45.169Z"), time("15:37:48.736Z")), "datetime-interval": interval(datetime("0534-12-08T08:20:31.487Z"), datetime("6778-02-16T22:40:21.653Z")) }
+{ "date": date("7986-11-25"), "time": time("12:49:39.736Z"), "datetime": datetime("-8337-01-30T15:23:07.598Z"), "duration": duration("-P184484Y7M2241423DT10H42M49.500S"), "year-month-duration": year-month-duration("-P546031Y3M"), "day-time-duration": day-time-duration("P2623386DT10H32M31.983S"), "date-interval": interval(date("-4514-05-24"), date("3337-08-26")), "time-interval": interval(time("04:16:42.321Z"), time("12:22:56.816Z")), "datetime-interval": interval(datetime("2129-12-12T13:18:35.758Z"), datetime("8647-07-01T13:10:19.691Z")) }
\ No newline at end of file
diff --git a/asterix-app/data/temporal/temporalData.json b/asterix-app/data/temporal/temporalData.json
index bedf2c7..6d662f9 100644
--- a/asterix-app/data/temporal/temporalData.json
+++ b/asterix-app/data/temporal/temporalData.json
@@ -1,4 +1,4 @@
-{"id": "001", "dateField": date("-2012-12-12"), "dateFieldPlus": date("0990-01-01"), "timeField": time("23:49:12.39Z"), "timeFieldPlus": time("03:23:12.2"), "datetimeField": datetime("2012-12-12T00:00:00.001"), "datetimeFieldPlus": datetime("-00130810T221015398"), "durationField": duration("P20Y19DT3H74M23.34S"), "durationFieldPlus": duration("-P2MT4M300.68S"), "intervalField": interval-datetime("2012-12-12T00:00:00.001,20130810T221015398") }
-{"id": "002", "timeField": time("12:12:12.219+08:00"), "timeField2": time("13:13:13.321-08:00"), "datetimeField": datetime("19201220T232918478-1200"), "intervalField": interval-time("12:29:30+08:00, 235959999-0800") }
-{"id": "003", "durationField": duration("-P27Y48DT2400H"), "datetimeField": datetime("-0290-03-23T00:59:48.999+07:00"), "intervalField": interval-date("-2012-03-17, 2013-04-01"), "intervalPlus": interval-time("19:23:32.328Z,23:20:20") }
+{"id": "001", "dateField": date("-2012-12-12"), "dateFieldPlus": date("0990-01-01"), "timeField": time("23:49:12.39Z"), "timeFieldPlus": time("03:23:12.2"), "datetimeField": datetime("2012-12-12T00:00:00.001"), "datetimeFieldPlus": datetime("-00130810T221015398"), "durationField": duration("P20Y19DT3H74M23.34S"), "durationFieldPlus": duration("-P2MT4M300.68S"), "intervalField": interval(datetime("2012-12-12T00:00:00.001"),datetime("20130810T221015398")) }
+{"id": "002", "timeField": time("12:12:12.219+08:00"), "timeField2": time("13:13:13.321-08:00"), "datetimeField": datetime("19201220T232918478-1200"), "intervalField": interval(time("12:29:30+08:00"), time("235959999-0800")) }
+{"id": "003", "durationField": duration("-P27Y48DT2400H"), "datetimeField": datetime("-0290-03-23T00:59:48.999+07:00"), "intervalField": interval(date("-2012-03-17"), date("2013-04-01")), "intervalPlus": interval(time("19:23:32.328Z"), time("23:20:20")) }
 {"id": "003", "dayTimeDurationField": day-time-duration("-P48DT2400H"), "yearMonthDurationField": year-month-duration("P27Y50M") }
\ No newline at end of file