asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject [08/13] incubator-asterixdb git commit: Add Support for Upsert Operation
Date Mon, 01 Feb 2016 08:31:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicationChannel.java
----------------------------------------------------------------------
diff --git a/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicationChannel.java b/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicationChannel.java
index fd1df0b..e4d94b4 100644
--- a/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicationChannel.java
+++ b/asterix-replication/src/main/java/org/apache/asterix/replication/management/ReplicationChannel.java
@@ -61,11 +61,12 @@ import org.apache.asterix.common.transactions.ILogRecord;
 import org.apache.asterix.common.transactions.LogRecord;
 import org.apache.asterix.common.transactions.LogSource;
 import org.apache.asterix.common.transactions.LogType;
-import org.apache.asterix.replication.functions.ReplicationProtocol;
-import org.apache.asterix.replication.functions.ReplicationProtocol.ReplicationRequestType;
+import org.apache.asterix.common.utils.TransactionUtil;
 import org.apache.asterix.replication.functions.ReplicaFilesRequest;
 import org.apache.asterix.replication.functions.ReplicaIndexFlushRequest;
 import org.apache.asterix.replication.functions.ReplicaLogsRequest;
+import org.apache.asterix.replication.functions.ReplicationProtocol;
+import org.apache.asterix.replication.functions.ReplicationProtocol.ReplicationRequestType;
 import org.apache.asterix.replication.logging.RemoteLogMapping;
 import org.apache.asterix.replication.storage.LSMComponentLSNSyncTask;
 import org.apache.asterix.replication.storage.LSMComponentProperties;
@@ -393,8 +394,8 @@ public class ReplicationChannel extends Thread implements IReplicationChannel {
                             long fileSize = fileChannel.size();
                             fileProperties.initialize(filePath, fileSize, replicaId, false,
                                     IMetaDataPageManager.INVALID_LSN_OFFSET, false);
-                            outBuffer = ReplicationProtocol.writeFileReplicationRequest(outBuffer,
-                                    fileProperties, ReplicationRequestType.REPLICATE_FILE);
+                            outBuffer = ReplicationProtocol.writeFileReplicationRequest(outBuffer, fileProperties,
+                                    ReplicationRequestType.REPLICATE_FILE);
 
                             //send file info
                             NetworkingUtil.transferBufferToChannel(socketChannel, outBuffer);
@@ -488,13 +489,14 @@ public class ReplicationChannel extends Thread implements IReplicationChannel {
 
             if (remoteLog.getLogType() == LogType.JOB_COMMIT) {
                 LogRecord jobCommitLog = new LogRecord();
-                jobCommitLog.formJobTerminateLogRecord(remoteLog.getJobId(), true, remoteLog.getNodeId());
+                TransactionUtil.formJobTerminateLogRecord(jobCommitLog, remoteLog.getJobId(), true,
+                        remoteLog.getNodeId());
                 jobCommitLog.setReplicationThread(this);
                 jobCommitLog.setLogSource(LogSource.REMOTE);
                 logManager.log(jobCommitLog);
             } else if (remoteLog.getLogType() == LogType.FLUSH) {
                 LogRecord flushLog = new LogRecord();
-                flushLog.formFlushLogRecord(remoteLog.getDatasetId(), null, remoteLog.getNodeId(),
+                TransactionUtil.formFlushLogRecord(flushLog, remoteLog.getDatasetId(), null, remoteLog.getNodeId(),
                         remoteLog.getNumOfFlushedIndexes());
                 flushLog.setReplicationThread(this);
                 flushLog.setLogSource(LogSource.REMOTE);
@@ -523,8 +525,8 @@ public class ReplicationChannel extends Thread implements IReplicationChannel {
             if (logRecord.getLogType() == LogType.JOB_COMMIT) {
                 //send ACK to requester
                 try {
-                    socketChannel.socket().getOutputStream().write(
-                            (localNodeID + ReplicationProtocol.JOB_COMMIT_ACK + logRecord.getJobId() + "\n")
+                    socketChannel.socket().getOutputStream()
+                            .write((localNodeID + ReplicationProtocol.JOB_COMMIT_ACK + logRecord.getJobId() + "\n")
                                     .getBytes());
                     socketChannel.socket().getOutputStream().flush();
                 } catch (IOException e) {
@@ -647,4 +649,4 @@ public class ReplicationChannel extends Thread implements IReplicationChannel {
             }
         }
     }
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableAvgAggregateFunction.java
index b61f3b2..24e6cb7 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableAvgAggregateFunction.java
@@ -95,7 +95,7 @@ public abstract class AbstractSerializableAvgAggregateFunction implements ICopyS
         try {
             state.writeDouble(0.0);
             state.writeLong(0);
-            state.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+            state.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
         } catch (IOException e) {
             throw new AlgebricksException(e);
         }
@@ -193,9 +193,9 @@ public abstract class AbstractSerializableAvgAggregateFunction implements ICopyS
                 if (GlobalConfig.DEBUG) {
                     GlobalConfig.ASTERIX_LOGGER.finest("AVG aggregate ran over empty input.");
                 }
-                result.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+                result.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
             } else if (aggType == ATypeTag.NULL) {
-                result.writeByte(ATypeTag.NULL.serialize());
+                result.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
             } else {
                 sumBytes.reset();
                 aDouble.setValue(sum);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSumAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSumAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSumAggregateFunction.java
index 3eae34a..5e6ca46 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSumAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/AbstractSerializableSumAggregateFunction.java
@@ -63,15 +63,14 @@ public abstract class AbstractSerializableSumAggregateFunction implements ICopyS
     @SuppressWarnings("rawtypes")
     public ISerializerDeserializer serde;
 
-    public AbstractSerializableSumAggregateFunction(ICopyEvaluatorFactory[] args)
-            throws AlgebricksException {
+    public AbstractSerializableSumAggregateFunction(ICopyEvaluatorFactory[] args) throws AlgebricksException {
         eval = args[0].createEvaluator(inputVal);
     }
 
     @Override
     public void init(DataOutput state) throws AlgebricksException {
         try {
-            state.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+            state.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
             state.writeDouble(0.0);
         } catch (IOException e) {
             throw new AlgebricksException(e);
@@ -202,8 +201,8 @@ public abstract class AbstractSerializableSumAggregateFunction implements ICopyS
                     break;
                 }
                 default:
-                    throw new AlgebricksException("SumAggregationFunction: incompatible type for the result ("
-                            + aggType + "). ");
+                    throw new AlgebricksException(
+                            "SumAggregationFunction: incompatible type for the result (" + aggType + "). ");
             }
         } catch (IOException e) {
             throw new AlgebricksException(e);
@@ -218,8 +217,11 @@ public abstract class AbstractSerializableSumAggregateFunction implements ICopyS
     protected boolean skipStep(byte[] state, int start) {
         return false;
     }
+
     protected abstract void processNull(byte[] state, int start);
+
     protected abstract void processSystemNull() throws AlgebricksException;
+
     protected abstract void finishSystemNull(DataOutput out) throws IOException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateFunction.java
index d7bb1e1..9773272 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableAvgAggregateFunction.java
@@ -47,8 +47,9 @@ public class SerializableAvgAggregateFunction extends AbstractSerializableAvgAgg
         finish(state, start, len, result);
     }
 
+    @Override
     protected void processNull(byte[] state, int start) {
-        state[start + AGG_TYPE_OFFSET] = ATypeTag.NULL.serialize();
+        state[start + AGG_TYPE_OFFSET] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateFunction.java
index a86c699..3a1298c 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableGlobalAvgAggregateFunction.java
@@ -48,8 +48,9 @@ public class SerializableGlobalAvgAggregateFunction extends AbstractSerializable
         finishPartialResults(state, start, len, result);
     }
 
+    @Override
     protected void processNull(byte[] state, int start) {
-        state[start + AGG_TYPE_OFFSET] = ATypeTag.NULL.serialize();
+        state[start + AGG_TYPE_OFFSET] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableIntermediateAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableIntermediateAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableIntermediateAvgAggregateFunction.java
index bf3a596..af21c9f 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableIntermediateAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableIntermediateAvgAggregateFunction.java
@@ -48,8 +48,9 @@ public class SerializableIntermediateAvgAggregateFunction extends AbstractSerial
         finishPartialResults(state, start, len, result);
     }
 
+    @Override
     protected void processNull(byte[] state, int start) {
-        state[start + AGG_TYPE_OFFSET] = ATypeTag.NULL.serialize();
+        state[start + AGG_TYPE_OFFSET] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateFunction.java
index 3f30472..1b7772f 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableLocalAvgAggregateFunction.java
@@ -48,8 +48,9 @@ public class SerializableLocalAvgAggregateFunction extends AbstractSerializableA
         finish(state, start, len, result);
     }
 
+    @Override
     protected void processNull(byte[] state, int start) {
-        state[start + AGG_TYPE_OFFSET] = ATypeTag.NULL.serialize();
+        state[start + AGG_TYPE_OFFSET] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
index fc91d8d..ef0dc3b 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/serializable/std/SerializableSumAggregateFunction.java
@@ -38,9 +38,9 @@ public class SerializableSumAggregateFunction extends AbstractSerializableSumAgg
         this.isLocalAgg = isLocalAgg;
     }
 
+    @Override
     protected void processNull(byte[] state, int start) {
-        ATypeTag aggType = ATypeTag.NULL;
-        state[start + AGG_TYPE_OFFSET] = aggType.serialize();
+        state[start + AGG_TYPE_OFFSET] = ATypeTag.SERIALIZED_NULL_TYPE_TAG;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java
index a4f9968..37d4b05 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractAvgAggregateFunction.java
@@ -182,9 +182,9 @@ public abstract class AbstractAvgAggregateFunction implements ICopyAggregateFunc
                 if (GlobalConfig.DEBUG) {
                     GlobalConfig.ASTERIX_LOGGER.finest("AVG aggregate ran over empty input.");
                 }
-                out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+                out.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
             } else if (aggType == ATypeTag.NULL) {
-                out.writeByte(ATypeTag.NULL.serialize());
+                out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
             } else {
                 sumBytes.reset();
                 aDouble.setValue(sum);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractMinMaxAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractMinMaxAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractMinMaxAggregateFunction.java
index aaf352a..e934ddb 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractMinMaxAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/AbstractMinMaxAggregateFunction.java
@@ -86,8 +86,8 @@ public abstract class AbstractMinMaxAggregateFunction implements ICopyAggregateF
             // Initialize min value.
             outputVal.assign(inputVal);
         } else if (typeTag != ATypeTag.SYSTEM_NULL && !ATypeHierarchy.isCompatible(typeTag, aggType)) {
-            throw new AlgebricksException("Unexpected type " + typeTag + " in aggregation input stream. Expected type "
-                    + aggType + ".");
+            throw new AlgebricksException(
+                    "Unexpected type " + typeTag + " in aggregation input stream. Expected type " + aggType + ".");
         } else {
 
             // If a system_null is encountered locally, it would be an error; otherwise if it is seen
@@ -161,7 +161,7 @@ public abstract class AbstractMinMaxAggregateFunction implements ICopyAggregateF
         try {
             switch (aggType) {
                 case NULL: {
-                    out.writeByte(ATypeTag.NULL.serialize());
+                    out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
                     break;
                 }
                 case SYSTEM_NULL: {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
index f227f9a..e0281bf 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/MinMaxAggregateFunction.java
@@ -34,6 +34,7 @@ public class MinMaxAggregateFunction extends AbstractMinMaxAggregateFunction {
         this.isLocalAgg = isLocalAgg;
     }
 
+    @Override
     protected void processNull() {
         aggType = ATypeTag.NULL;
     }
@@ -54,9 +55,9 @@ public class MinMaxAggregateFunction extends AbstractMinMaxAggregateFunction {
     protected void finishSystemNull() throws IOException {
         // Empty stream. For local agg return system null. For global agg return null.
         if (isLocalAgg) {
-            out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+            out.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
         } else {
-            out.writeByte(ATypeTag.NULL.serialize());
+            out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/SqlMinMaxAggregateFunction.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/SqlMinMaxAggregateFunction.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/SqlMinMaxAggregateFunction.java
index cc8715c..1841ed0 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/SqlMinMaxAggregateFunction.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/aggregates/std/SqlMinMaxAggregateFunction.java
@@ -49,9 +49,9 @@ public class SqlMinMaxAggregateFunction extends AbstractMinMaxAggregateFunction
     protected void finishSystemNull() throws IOException {
         // Empty stream. For local agg return system null. For global agg return null.
         if (isLocalAgg) {
-            out.writeByte(ATypeTag.SYSTEM_NULL.serialize());
+            out.writeByte(ATypeTag.SERIALIZED_SYSTEM_NULL_TYPE_TAG);
         } else {
-            out.writeByte(ATypeTag.NULL.serialize());
+            out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
index d8c442a..7bddb09 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleCenterAccessor.java
@@ -46,11 +46,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class CircleCenterAccessor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_CIRCLE_CENTER_ACCESSOR;
-    private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
-    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -89,14 +85,14 @@ public class CircleCenterAccessor extends AbstractScalarFunctionDynamicDescripto
                         try {
                             double cX;
                             double cY;
-                            if (bytes[0] == SER_CICLE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_CIRCLE_TYPE_TAG) {
                                 cX = ADoubleSerializerDeserializer.getDouble(bytes,
                                         ACircleSerializerDeserializer.getCenterPointCoordinateOffset(Coordinate.X));
                                 cY = ADoubleSerializerDeserializer.getDouble(bytes,
                                         ACircleSerializerDeserializer.getCenterPointCoordinateOffset(Coordinate.Y));
                                 aPoint.setValue(cX, cY);
                                 pointSerde.serialize(aPoint, out);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException("get-center does not support the type: " + bytes[0]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
index 23a5686..d44f43a 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/CircleRadiusAccessor.java
@@ -43,13 +43,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class CircleRadiusAccessor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_CIRCLE_RADIUS_ACCESSOR;
-    private static final byte SER_CICLE_TAG = ATypeTag.CIRCLE.serialize();
-    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -87,12 +82,12 @@ public class CircleRadiusAccessor extends AbstractScalarFunctionDynamicDescripto
 
                         try {
                             double radius;
-                            if (bytes[0] == SER_CICLE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_CIRCLE_TYPE_TAG) {
                                 radius = ADoubleSerializerDeserializer.getDouble(bytes,
                                         ACircleSerializerDeserializer.getRadiusOffset());
                                 aDouble.setValue(radius);
                                 doubleSerde.serialize(aDouble, out);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException("get-radius does not support the type: " + bytes[0]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
index 712e53c..b9f7248 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/LineRectanglePolygonAccessor.java
@@ -50,15 +50,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINTS_LINE_RECTANGLE_POLYGON_ACCESSOR;
-    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 static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -99,7 +92,7 @@ public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicD
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_LINE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_LINE_TYPE_TAG) {
                                 listBuilder.reset(pointListType);
 
                                 inputVal.reset();
@@ -121,7 +114,7 @@ public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicD
                                 listBuilder.addItem(inputVal);
                                 listBuilder.write(out, true);
 
-                            } else if (bytes[0] == SER_RECTANGLE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_RECTANGLE_TYPE_TAG) {
                                 listBuilder.reset(pointListType);
 
                                 inputVal.reset();
@@ -143,7 +136,7 @@ public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicD
                                 listBuilder.addItem(inputVal);
                                 listBuilder.write(out, true);
 
-                            } else if (bytes[0] == SER_POLYGON_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_POLYGON_TYPE_TAG) {
                                 int numOfPoints = AInt16SerializerDeserializer.getShort(bytes,
                                         APolygonSerializerDeserializer.getNumberOfPointsOffset());
 
@@ -162,7 +155,7 @@ public class LineRectanglePolygonAccessor extends AbstractScalarFunctionDynamicD
                                     listBuilder.addItem(inputVal);
                                 }
                                 listBuilder.write(out, true);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException("get-points does not support the type: " + bytes[0]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
index 62b7a1f..b84ff77 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointXCoordinateAccessor.java
@@ -44,13 +44,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class PointXCoordinateAccessor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_X_COORDINATE_ACCESSOR;
-    private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
-    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -88,12 +83,12 @@ public class PointXCoordinateAccessor extends AbstractScalarFunctionDynamicDescr
 
                         try {
                             double x;
-                            if (bytes[0] == SER_POINT_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_POINT_TYPE_TAG) {
                                 x = ADoubleSerializerDeserializer.getDouble(bytes,
                                         APointSerializerDeserializer.getCoordinateOffset(Coordinate.X));
                                 aDouble.setValue(x);
                                 doubleSerde.serialize(aDouble, out);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException("get-x does not support the type: " + bytes[0]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
index e6e9f51..c03758d 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/PointYCoordinateAccessor.java
@@ -48,8 +48,6 @@ public class PointYCoordinateAccessor extends AbstractScalarFunctionDynamicDescr
     private static final long serialVersionUID = 1L;
 
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.GET_POINT_Y_COORDINATE_ACCESSOR;
-    private static final byte SER_POINT_TAG = ATypeTag.POINT.serialize();
-    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
@@ -88,12 +86,12 @@ public class PointYCoordinateAccessor extends AbstractScalarFunctionDynamicDescr
 
                         try {
                             double y;
-                            if (bytes[0] == SER_POINT_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_POINT_TYPE_TAG) {
                                 y = ADoubleSerializerDeserializer.getDouble(bytes,
                                         APointSerializerDeserializer.getCoordinateOffset(Coordinate.Y));
                                 aDouble.setValue(y);
                                 doubleSerde.serialize(aDouble, out);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException("get-y does not support the type: " + bytes[0]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
index de1d42d..b8f76d1 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalDayAccessor.java
@@ -48,16 +48,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class TemporalDayAccessor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_DAY;
-
-    // allowed input types
-    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() {
 
         @Override
@@ -104,27 +95,27 @@ public class TemporalDayAccessor extends AbstractScalarFunctionDynamicDescriptor
 
                         try {
 
-                            if (bytes[0] == SER_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationDay(ADurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(
+                                        calSystem.getDurationDay(ADurationSerializerDeserializer.getDayTime(bytes, 1)));
                                 intSerde.serialize(aMutableInt64, out);
                                 return;
                             }
 
-                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationDay(ADayTimeDurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_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) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1)
                                         * GregorianCalendarSystem.CHRONON_OF_DAY;
-                            } else if (bytes[0] == SER_DATETIME_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt64SerializerDeserializer.getLong(bytes, 1);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             } else {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
index cf170ec..6b7dbdb 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalHourAccessor.java
@@ -48,16 +48,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class TemporalHourAccessor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_HOUR;
-
-    // allowed input types
-    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() {
 
         @Override
@@ -105,26 +96,26 @@ public class TemporalHourAccessor extends AbstractScalarFunctionDynamicDescripto
 
                         try {
 
-                            if (bytes[0] == SER_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationHour(ADurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationHour(ADurationSerializerDeserializer.getDayTime(bytes, 1)));
                                 intSerde.serialize(aMutableInt64, out);
                                 return;
                             }
 
-                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationHour(ADayTimeDurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_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) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);
-                            } else if (bytes[0] == SER_DATETIME_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt64SerializerDeserializer.getLong(bytes, 1);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             } else {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
index b0fa757..8e42b79 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndAccessor.java
@@ -49,16 +49,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class TemporalIntervalEndAccessor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_END;
-
-    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();
-    private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
-    private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -67,6 +58,7 @@ public class TemporalIntervalEndAccessor extends AbstractScalarFunctionDynamicDe
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -106,19 +98,19 @@ public class TemporalIntervalEndAccessor extends AbstractScalarFunctionDynamicDe
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
-                                if (timeType == SER_DATE_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                     aDate.setValue((int) (endTime));
                                     dateSerde.serialize(aDate, out);
-                                } else if (timeType == SER_TIME_TYPE_TAG) {
+                                } else if (timeType == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                     aTime.setValue((int) (endTime));
                                     timeSerde.serialize(aTime, out);
-                                } else if (timeType == SER_DATETIME_TYPE_TAG) {
+                                } else if (timeType == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                     aDateTime.setValue(endTime);
                                     datetimeSerde.serialize(aDateTime, out);
                                 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
index c9c2312..38141a2 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDateAccessor.java
@@ -43,16 +43,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.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
@@ -61,6 +53,7 @@ public class TemporalIntervalEndDateAccessor extends AbstractScalarFunctionDynam
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -93,24 +86,24 @@ public class TemporalIntervalEndDateAccessor extends AbstractScalarFunctionDynam
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
-                                if (timeType == SER_DATE_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_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]));
+                                    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]));
+                                throw new AlgebricksException(
+                                        FID.getName() + ": expects NULL/INTERVAL(of DATE), but got "
+                                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
                             }
                         } catch (IOException e) {
                             throw new AlgebricksException(e);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
index 222d616..e610363 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndDatetimeAccessor.java
@@ -47,12 +47,6 @@ public class TemporalIntervalEndDatetimeAccessor extends AbstractScalarFunctionD
     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
@@ -61,6 +55,7 @@ public class TemporalIntervalEndDatetimeAccessor extends AbstractScalarFunctionD
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -92,13 +87,13 @@ public class TemporalIntervalEndDatetimeAccessor extends AbstractScalarFunctionD
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
-                                if (timeType == SER_DATETIME_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                     aDateTime.setValue(endTime);
                                     datetimeSerde.serialize(aDateTime, out);
                                 } else {
@@ -107,9 +102,9 @@ public class TemporalIntervalEndDatetimeAccessor extends AbstractScalarFunctionD
                                             + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
                                 }
                             } else {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": expects NULL/INTERVAL(of DATETIME), but got "
-                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                                throw new AlgebricksException(
+                                        FID.getName() + ": expects NULL/INTERVAL(of DATETIME), but got "
+                                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
                             }
                         } catch (IOException e) {
                             throw new AlgebricksException(e);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
index f684a9c..dc5ff7e 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalEndTimeAccessor.java
@@ -43,16 +43,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.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
@@ -61,6 +53,7 @@ public class TemporalIntervalEndTimeAccessor extends AbstractScalarFunctionDynam
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -92,13 +85,13 @@ public class TemporalIntervalEndTimeAccessor extends AbstractScalarFunctionDynam
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long endTime = AIntervalSerializerDeserializer.getIntervalEnd(bytes, 1);
-                                if (timeType == SER_TIME_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                     aTime.setValue((int) (endTime));
                                     timeSerde.serialize(aTime, out);
                                 } else {
@@ -107,9 +100,9 @@ public class TemporalIntervalEndTimeAccessor extends AbstractScalarFunctionDynam
                                             + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
                                 }
                             } else {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": expects NULL/INTERVAL(of TIME), but got "
-                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                                throw new AlgebricksException(
+                                        FID.getName() + ": expects NULL/INTERVAL(of TIME), but got "
+                                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
                             }
                         } catch (IOException e) {
                             throw new AlgebricksException(e);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
index 9eb6c44..3c2440b 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartAccessor.java
@@ -49,16 +49,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class TemporalIntervalStartAccessor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_INTERVAL_START;
-
-    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();
-    private static final byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
-    private static final byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -67,6 +58,7 @@ public class TemporalIntervalStartAccessor extends AbstractScalarFunctionDynamic
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -106,19 +98,19 @@ public class TemporalIntervalStartAccessor extends AbstractScalarFunctionDynamic
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
-                                if (timeType == SER_DATE_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                     aDate.setValue((int) (startTime));
                                     dateSerde.serialize(aDate, out);
-                                } else if (timeType == SER_TIME_TYPE_TAG) {
+                                } else if (timeType == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                     aTime.setValue((int) (startTime));
                                     timeSerde.serialize(aTime, out);
-                                } else if (timeType == SER_DATETIME_TYPE_TAG) {
+                                } else if (timeType == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                     aDateTime.setValue(startTime);
                                     datetimeSerde.serialize(aDateTime, out);
                                 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
index 604c868..ff2a92b 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDateAccessor.java
@@ -45,14 +45,7 @@ import org.apache.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
@@ -61,6 +54,7 @@ public class TemporalIntervalStartDateAccessor extends AbstractScalarFunctionDyn
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -92,13 +86,13 @@ public class TemporalIntervalStartDateAccessor extends AbstractScalarFunctionDyn
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
-                                if (timeType == SER_DATE_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                     aDate.setValue((int) (startTime));
                                     dateSerde.serialize(aDate, out);
                                 } else {
@@ -107,9 +101,9 @@ public class TemporalIntervalStartDateAccessor extends AbstractScalarFunctionDyn
                                             + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
                                 }
                             } else {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": expects NULL/INTERVAL(of DATE), but got "
-                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                                throw new AlgebricksException(
+                                        FID.getName() + ": expects NULL/INTERVAL(of DATE), but got "
+                                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
                             }
                         } catch (IOException e) {
                             throw new AlgebricksException(e);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
index 0b52fbc..c88b8f0 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartDatetimeAccessor.java
@@ -43,16 +43,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.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
@@ -61,6 +53,7 @@ public class TemporalIntervalStartDatetimeAccessor extends AbstractScalarFunctio
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -92,13 +85,13 @@ public class TemporalIntervalStartDatetimeAccessor extends AbstractScalarFunctio
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
-                                if (timeType == SER_DATETIME_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                     aDateTime.setValue(startTime);
                                     datetimeSerde.serialize(aDateTime, out);
                                 } else {
@@ -107,9 +100,9 @@ public class TemporalIntervalStartDatetimeAccessor extends AbstractScalarFunctio
                                             + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(timeType) + ")");
                                 }
                             } else {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": expects NULL/INTERVAL(of DATETIME), but got "
-                                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
+                                throw new AlgebricksException(
+                                        FID.getName() + ": expects NULL/INTERVAL(of DATETIME), but got "
+                                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(bytes[0]));
                             }
                         } catch (IOException e) {
                             throw new AlgebricksException(e);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
index 6605857..8308d1f 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalIntervalStartTimeAccessor.java
@@ -45,14 +45,7 @@ import org.apache.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
@@ -61,6 +54,7 @@ public class TemporalIntervalStartTimeAccessor extends AbstractScalarFunctionDyn
         }
     };
 
+    @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) throws AlgebricksException {
         return new ICopyEvaluatorFactory() {
 
@@ -92,13 +86,13 @@ public class TemporalIntervalStartTimeAccessor extends AbstractScalarFunctionDyn
                         byte[] bytes = argOut.getByteArray();
 
                         try {
-                            if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
-                            } else if (bytes[0] == SER_INTERVAL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_INTERVAL_TYPE_TAG) {
                                 byte timeType = AIntervalSerializerDeserializer.getIntervalTimeType(bytes, 1);
                                 long startTime = AIntervalSerializerDeserializer.getIntervalStart(bytes, 1);
-                                if (timeType == SER_TIME_TYPE_TAG) {
+                                if (timeType == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                     aTime.setValue((int) (startTime));
                                     timeSerde.serialize(aTime, out);
                                 } else {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
index 8f2c60e..a20e541 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMillisecondAccessor.java
@@ -46,18 +46,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class TemporalMillisecondAccessor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_MILLISEC;
-
-    // allowed input types
-    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() {
 
         @Override
@@ -105,27 +95,26 @@ public class TemporalMillisecondAccessor extends AbstractScalarFunctionDynamicDe
 
                         try {
 
-                            if (bytes[0] == SER_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationMillisecond(ADurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationMillisecond(ADurationSerializerDeserializer.getDayTime(bytes, 1)));
                                 intSerde.serialize(aMutableInt64, out);
                                 return;
                             }
 
-                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem
-                                        .getDurationMillisecond(ADayTimeDurationSerializerDeserializer.getDayTime(
-                                                bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_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) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);
-                            } else if (bytes[0] == SER_DATETIME_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt64SerializerDeserializer.getLong(bytes, 1);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             } else {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
index cba5e92..07e7c2d 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMinuteAccessor.java
@@ -51,13 +51,6 @@ public class TemporalMinuteAccessor extends AbstractScalarFunctionDynamicDescrip
 
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_MIN;
 
-    // allowed input types
-    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() {
 
         @Override
@@ -105,27 +98,26 @@ public class TemporalMinuteAccessor extends AbstractScalarFunctionDynamicDescrip
 
                         try {
 
-                            if (bytes[0] == SER_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationMinute(ADurationSerializerDeserializer
-                                        .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationMinute(ADurationSerializerDeserializer.getDayTime(bytes, 1)));
                                 intSerde.serialize(aMutableInt64, out);
                                 return;
                             }
 
-                            if (bytes[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
-                                aMutableInt64
-                                        .setValue(calSystem.getDurationMinute(ADayTimeDurationSerializerDeserializer
-                                                .getDayTime(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_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) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1);
-                            } else if (bytes[0] == SER_DATETIME_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt64SerializerDeserializer.getLong(bytes, 1);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             } else {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
index 48856ca..5d721c4 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/accessors/TemporalMonthAccessor.java
@@ -46,18 +46,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class TemporalMonthAccessor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
     private static final FunctionIdentifier FID = AsterixBuiltinFunctions.ACCESSOR_TEMPORAL_MONTH;
-
-    // allowed input types
-    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() {
 
         @Override
@@ -105,28 +95,27 @@ public class TemporalMonthAccessor extends AbstractScalarFunctionDynamicDescript
 
                         try {
 
-                            if (bytes[0] == SER_DURATION_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem.getDurationMonth(ADurationSerializerDeserializer
-                                        .getYearMonth(bytes, 1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
+                                aMutableInt64.setValue(calSystem
+                                        .getDurationMonth(ADurationSerializerDeserializer.getYearMonth(bytes, 1)));
                                 intSerde.serialize(aMutableInt64, out);
                                 return;
                             }
 
-                            if (bytes[0] == SER_YEAR_MONTH_TYPE_TAG) {
-                                aMutableInt64.setValue(calSystem
-                                        .getDurationMonth(AYearMonthDurationSerializerDeserializer.getYearMonth(bytes,
-                                                1)));
+                            if (bytes[0] == ATypeTag.SERIALIZED_YEAR_MONTH_DURATION_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) {
+                            if (bytes[0] == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                 chrononTimeInMs = AInt32SerializerDeserializer.getInt(bytes, 1)
                                         * GregorianCalendarSystem.CHRONON_OF_DAY;
-                            } else if (bytes[0] == SER_DATETIME_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 chrononTimeInMs = AInt64SerializerDeserializer.getLong(bytes, 1);
-                            } else if (bytes[0] == SER_NULL_TYPE_TAG) {
+                            } else if (bytes[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             } else {


Mime
View raw message