asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [56/58] [abbrv] incubator-asterixdb git commit: Temporal update based on a merge from an old branch.
Date Fri, 24 Apr 2015 18:43:22 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
index c8f467b..c43e25a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
@@ -17,7 +17,6 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ACircleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -45,7 +44,7 @@ public class CircleRadiusAccessor extends AbstractScalarFunctionDynamicDescripto
 
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_CIRCLE_RADIUS_ACCESSOR;
     private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
index e5496ca..27f9370 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
@@ -18,7 +18,6 @@ import java.io.DataOutput;
 import java.io.IOException;
 
 import edu.uci.ics.asterix.builders.OrderedListBuilder;
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
@@ -54,7 +53,7 @@ public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicD
     private static final byte SER_LINE_TAG = ATypeTag.LINE.serialize();
     private static final byte SER_RECTANGLE_TAG = ATypeTag.RECTANGLE.serialize();
     private static final byte SER_POLYGON_TAG = ATypeTag.POLYGON.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
index 498fa39..97f94c7 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
@@ -17,7 +17,6 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
@@ -46,7 +45,7 @@ public class PointXCoordinateAccessor extends AbstractScalarFunctionDynamicDescr
 
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_X_COORDINATE_ACCESSOR;
     private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
index 72d7072..37d33d8 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
@@ -17,7 +17,6 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import edu.uci.ics.asterix.common.functions.FunctionConstants;
 import edu.uci.ics.asterix.dataflow.data.nontagged.Coordinate;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
@@ -46,7 +45,7 @@ public class PointYCoordinateAccessor extends AbstractScalarFunctionDynamicDescr
 
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_Y_COORDINATE_ACCESSOR;
     private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
index fb9bf4c..2497b54 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
@@ -17,6 +17,7 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
@@ -50,6 +51,7 @@ public class TemporalDayAccessor extends AbstractScalarFunctionDynamicDescriptor
     private static final byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -73,21 +75,21 @@ public class TemporalDayAccessor extends AbstractScalarFunctionDynamicDescriptor
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -105,6 +107,13 @@ public class TemporalDayAccessor extends AbstractScalarFunctionDynamicDescriptor
                                 return;
                             }
 
+                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem.getDurationDay(ADayTimeDurationSerializerDeserializer
+                                        .getDayTime(bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_DATE_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
index 33dc9fd..2024d61 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
@@ -17,6 +17,7 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
@@ -50,6 +51,7 @@ public class TemporalHourAccessor extends AbstractScalarFunctionDynamicDescripto
     private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -74,21 +76,21 @@ public class TemporalHourAccessor extends AbstractScalarFunctionDynamicDescripto
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -106,6 +108,13 @@ public class TemporalHourAccessor extends AbstractScalarFunctionDynamicDescripto
                                 return;
                             }
 
+                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem.getDurationHour(ADayTimeDurationSerializerDeserializer
+                                        .getDayTime(bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
index e8ea6d5..e6789a1 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
@@ -72,27 +72,27 @@ public class TemporalIntervalEndAccessor extends AbstractScalarFunctionDynamicDe
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
                     // possible output
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATE);
-                    private AMutableDate aDate = new AMutableDate(0);
+                    private final AMutableDate aDate = new AMutableDate(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATETIME);
-                    private AMutableDateTime aDateTime = new AMutableDateTime(0);
+                    private final AMutableDateTime aDateTime = new AMutableDateTime(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ATIME);
-                    private AMutableTime aTime = new AMutableTime(0);
+                    private final AMutableTime aTime = new AMutableTime(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
new file mode 100644
index 0000000..5f3832e
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+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.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalEndDateAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_END_DATE;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalEndDateAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADATE);
+                    private final AMutableDate aDate = new AMutableDate(0);
+
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
+                                if (timeType == SER_DATE_TYPE_TAG) {
+                                    aDate.setValue((int) (endTime));
+                                    dateSerde.serialize(aDate, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of DATE), but got "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/INTERVAL(of DATE), but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
new file mode 100644
index 0000000..a59fdf6
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+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.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalEndDatetimeAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_END_DATETIME;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalEndDatetimeAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADATETIME);
+                    private final AMutableDateTime aDateTime = new AMutableDateTime(0);
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
+                                if (timeType == SER_DATETIME_TYPE_TAG) {
+                                    aDateTime.setValue(endTime);
+                                    datetimeSerde.serialize(aDateTime, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of DATETIME), but got INTERVAL(of "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/INTERVAL(of DATETIME), but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
new file mode 100644
index 0000000..83bd135
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+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.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalEndTimeAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_END_TIME;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalEndTimeAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ATIME);
+                    private final AMutableTime aTime = new AMutableTime(0);
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
+                                if (timeType == SER_TIME_TYPE_TAG) {
+                                    aTime.setValue((int) (endTime));
+                                    timeSerde.serialize(aTime, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of TIME), but got INTERVAL(of "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/INTERVAL(of TIME), but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
index ef76934..0db2063 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
@@ -72,27 +72,27 @@ public class TemporalIntervalStartAccessor extends AbstractScalarFunctionDynamic
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
                     // possible output
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATE);
-                    private AMutableDate aDate = new AMutableDate(0);
+                    private final AMutableDate aDate = new AMutableDate(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ADATETIME);
-                    private AMutableDateTime aDateTime = new AMutableDateTime(0);
+                    private final AMutableDateTime aDateTime = new AMutableDateTime(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ATIME);
-                    private AMutableTime aTime = new AMutableTime(0);
+                    private final AMutableTime aTime = new AMutableTime(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
new file mode 100644
index 0000000..b533859
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+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.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalStartDateAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_START_DATE;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalStartDateAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ADate> dateSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADATE);
+                    private final AMutableDate aDate = new AMutableDate(0);
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
+                                if (timeType == SER_DATE_TYPE_TAG) {
+                                    aDate.setValue((int) (startTime));
+                                    dateSerde.serialize(aDate, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of DATE), but got INTERVAL(of "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/INTERVAL(of DATE), but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
new file mode 100644
index 0000000..25e9d59
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+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.ANull;
+import edu.uci.ics.asterix.om.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalStartDatetimeAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_START_DATETIME;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalStartDatetimeAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ADateTime> datetimeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ADATETIME);
+                    private final AMutableDateTime aDateTime = new AMutableDateTime(0);
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
+                                if (timeType == SER_DATETIME_TYPE_TAG) {
+                                    aDateTime.setValue(startTime);
+                                    datetimeSerde.serialize(aDateTime, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of DATETIME), but got INTERVAL(of "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName()
+                                        + ": expects NULL/INTERVAL(of DATETIME), but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
new file mode 100644
index 0000000..ca1f5c2
--- /dev/null
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.runtime.evaluators.accessors;
+
+import java.io.DataOutput;
+import java.io.IOException;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
+import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
+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.functions.AsterixBuiltinFunctions;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
+import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluator;
+import edu.uci.ics.hyracks.algebricks.runtime.base.ICopyEvaluatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
+import edu.uci.ics.hyracks.data.std.api.IDataOutputProvider;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+
+public class TemporalIntervalStartTimeAccessor extends AbstractScalarFunctionDynamicDescriptor {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_START_TIME;
+
+    private static final byte SER_INTERVAL_TYPE_TAG = ATypeTag.INTERVAL.serialize();
+    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
+
+    private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
+
+    public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+
+        @Override
+        public IFunctionDescriptor createFunctionDescriptor() {
+            return new TemporalIntervalStartTimeAccessor();
+        }
+    };
+
+    public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
+        return new ICopyEvaluatorFactory() {
+
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
+                return new ICopyEvaluator() {
+
+                    private final DataOutput out = output.getDataOutput();
+
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
+
+                    // possible output
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ATime> timeSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ATIME);
+                    private final AMutableTime aTime = new AMutableTime(0);
+                    @SuppressWarnings("unchecked")
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                            .getSerializerDeserializer(BuiltinType.ANULL);
+
+                    @Override
+                    public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
+                        argOut.reset();
+                        eval.evaluate(tuple);
+                        byte[] bytes = argOut.getByteArray();
+
+                        try {
+                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                                nullSerde.serialize(ANull.NULL, out);
+                                return;
+                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                                byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
+                                long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
+                                if (timeType == SER_TIME_TYPE_TAG) {
+                                    aTime.setValue((int) (startTime));
+                                    timeSerde.serialize(aTime, out);
+                                } else {
+                                    throw new AlgebricksException(FID.getName()
+                                            + ": expects NULL/INTERVAL(of TIME), but got INTERVAL(of "
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]) + ")");
+                                }
+                            } else {
+                                throw new AlgebricksException(FID.getName() + ": expects NULL/INTERVAL, but got "
+                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                            }
+                        } catch (IOException e) {
+                            throw new AlgebricksException(e);
+                        }
+                    }
+                };
+            }
+        };
+    }
+
+    /* (non-Javadoc)
+     * @see edu.uci.ics.asterix.om.functions.AbstractFunctionDescriptor#getIdentifier()
+     */
+    @Override
+    public FunctionIdentifier getIdentifier() {
+        return FID;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
index 701ecd3..35ae381 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
@@ -17,6 +17,7 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
@@ -50,6 +51,7 @@ public class TemporalMillisecondAccessor extends AbstractScalarFunctionDynamicDe
     private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -74,21 +76,21 @@ public class TemporalMillisecondAccessor extends AbstractScalarFunctionDynamicDe
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -106,6 +108,14 @@ public class TemporalMillisecondAccessor extends AbstractScalarFunctionDynamicDe
                                 return;
                             }
 
+                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationMillisecond(ADayTimeDurationSerializerDeserializer.getDayTime(
+                                                bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
index 13c3213..727c797 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
@@ -17,6 +17,7 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
@@ -50,6 +51,7 @@ public class TemporalMinuteAccessor extends AbstractScalarFunctionDynamicDescrip
     private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -74,21 +76,21 @@ public class TemporalMinuteAccessor extends AbstractScalarFunctionDynamicDescrip
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -106,6 +108,14 @@ public class TemporalMinuteAccessor extends AbstractScalarFunctionDynamicDescrip
                                 return;
                             }
 
+                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                aMutableInt64
+                                        .setValue(calSystem.getDurationMinute(ADayTimeDurationSerializerDeserializer
+                                                .getDayTime(bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
index 85c6aee..ead5445 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 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.dataflow.data.nontagged.serde.AYearMonthDurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AInt64;
 import edu.uci.ics.asterix.om.base.AMutableInt64;
@@ -50,6 +51,7 @@ public class TemporalMonthAccessor extends AbstractScalarFunctionDynamicDescript
     private static final byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_YEAR_MONTH_TYPE_TAG = ATypeTag.YEARMONTHDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -74,21 +76,21 @@ public class TemporalMonthAccessor extends AbstractScalarFunctionDynamicDescript
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -106,6 +108,14 @@ public class TemporalMonthAccessor extends AbstractScalarFunctionDynamicDescript
                                 return;
                             }
 
+                            if (bytes[0] == SER_YEAR_MONTH_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationMonth(AYearMonthDurationSerializerDeserializer.getYearMonth(bytes,
+                                                1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_DATE_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalSecondAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalSecondAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalSecondAccessor.java
index 25ebbbc..c94bc4a 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalSecondAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalSecondAccessor.java
@@ -17,6 +17,7 @@ package edu.uci.ics.asterix.runtime.evaluators.accessors;
 import java.io.DataOutput;
 import java.io.IOException;
 
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADayTimeDurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
@@ -50,6 +51,7 @@ public class TemporalSecondAccessor extends AbstractScalarFunctionDynamicDescrip
     private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
@@ -74,21 +76,21 @@ public class TemporalSecondAccessor extends AbstractScalarFunctionDynamicDescrip
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -106,6 +108,14 @@ public class TemporalSecondAccessor extends AbstractScalarFunctionDynamicDescrip
                                 return;
                             }
 
+                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                                aMutableInt64
+                                        .setValue(calSystem.getDurationSecond(ADayTimeDurationSerializerDeserializer
+                                                .getDayTime(bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/4a9a7d99/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalYearAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalYearAccessor.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalYearAccessor.java
index b9520d9..8ee5cd6 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalYearAccessor.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/evaluators/accessors/TemporalYearAccessor.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADurationSerializerDeserializer;
 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.dataflow.data.nontagged.serde.AYearMonthDurationSerializerDeserializer;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
 import edu.uci.ics.asterix.om.base.AInt64;
 import edu.uci.ics.asterix.om.base.AMutableInt64;
@@ -51,6 +52,7 @@ public class TemporalYearAccessor extends AbstractScalarFunctionDynamicDescripto
     private static final byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
     private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
     private static final byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
+    private static final byte SER_YEAR_MONTH_DURATION_TYPE_TAG = ATypeTag.YEARMONTHDURATION.serialize();
     private static final byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
@@ -72,21 +74,21 @@ public class TemporalYearAccessor extends AbstractScalarFunctionDynamicDescripto
             public ICopyEvaluator createEvaluator(final IDataOutputProvider output) throws AlgebricksException {
                 return new ICopyEvaluator() {
 
-                    private DataOutput out = output.getDataOutput();
+                    private final DataOutput out = output.getDataOutput();
 
-                    private ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
+                    private final ArrayBackedValueStorage argOut = new ArrayBackedValueStorage();
 
-                    private ICopyEvaluator eval = args[0].createEvaluator(argOut);
+                    private final ICopyEvaluator eval = args[0].createEvaluator(argOut);
 
-                    private GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
+                    private final GregorianCalendarSystem calSystem = GregorianCalendarSystem.getInstance();
 
                     // for output: type integer
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<AInt64> intSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.AINT64);
-                    private AMutableInt64 aMutableInt64 = new AMutableInt64(0);
+                    private final AMutableInt64 aMutableInt64 = new AMutableInt64(0);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
+                    private final ISerializerDeserializer<ANull> nullSerde = AqlSerializerDeserializerProvider.INSTANCE
                             .getSerializerDeserializer(BuiltinType.ANULL);
 
                     @Override
@@ -104,6 +106,14 @@ public class TemporalYearAccessor extends AbstractScalarFunctionDynamicDescripto
                                 return;
                             }
 
+                            if (bytes[0] == SER_YEAR_MONTH_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationYear(AYearMonthDurationSerializerDeserializer
+                                                .getYearMonth(bytes, 1)));
+                                intSerde.serialize(aMutableInt64, out);
+                                return;
+                            }
+
                             long chrononTimeInMs = 0;
                             if (bytes[0] == SER_DATE_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1)


Mime
View raw message