asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amo...@apache.org
Subject [06/13] incubator-asterixdb git commit: Add Support for Upsert Operation
Date Mon, 01 Feb 2016 08:31:25 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
index b82dcac..5638227 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateConstructorDescriptor.java
@@ -56,14 +56,8 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
 
     private static final long serialVersionUID = 1L;
     public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_DATE;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_DATE_TYPE_TAG = ATypeTag.DATE.serialize();
-    private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
-    private final static byte SER_YEAR_MONTH_DURATION_TYPE_TAG = ATypeTag.YEARMONTHDURATION.serialize();
-    private final static byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AIntervalStartFromDateConstructorDescriptor();
         }
@@ -106,18 +100,18 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
 
                         try {
 
-                            if (argOut0.getByteArray()[0] == SER_NULL_TYPE_TAG
-                                    || argOut1.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                                    || argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             }
 
                             long intervalStart = 0, intervalEnd = 0;
 
-                            if (argOut0.getByteArray()[0] == SER_DATE_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_DATE_TYPE_TAG) {
                                 intervalStart = ADateSerializerDeserializer.getChronon(argOut0.getByteArray(), 1)
                                         * GregorianCalendarSystem.CHRONON_OF_DAY;
-                            } else if (argOut0.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 utf8Ptr.set(argOut0.getByteArray(), 1, argOut0.getLength() - 1);
                                 // start date
                                 int stringLength = utf8Ptr.getUTF8Length();
@@ -130,28 +124,27 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            if (argOut1.getByteArray()[0] == SER_DURATION_TYPE_TAG) {
+                            if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         ADurationSerializerDeserializer.getYearMonth(argOut1.getByteArray(), 1),
                                         ADurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1), false);
-                            } else if (argOut1.getByteArray()[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
-                                intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
-                                        0,
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DAY_TIME_DURATION_TYPE_TAG) {
+                                intervalEnd = DurationArithmeticOperations.addDuration(intervalStart, 0,
                                         ADayTimeDurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1),
                                         false);
-                            } else if (argOut1.getByteArray()[0] == SER_YEAR_MONTH_DURATION_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_YEAR_MONTH_DURATION_TYPE_TAG) {
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
-                                        AYearMonthDurationSerializerDeserializer
-                                                .getYearMonth(argOut1.getByteArray(), 1),
+                                        AYearMonthDurationSerializerDeserializer.getYearMonth(argOut1.getByteArray(),
+                                                1),
                                         0, false);
-                            } else if (argOut1.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 // duration
                                 utf8Ptr.set(argOut1.getByteArray(), 1, argOut1.getLength() - 1);
                                 int stringLength = utf8Ptr.getUTF8Length();
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), utf8Ptr.getCharStartOffset(),
-                                                stringLength, aDuration, ADurationParseOption.All);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(),
+                                        utf8Ptr.getCharStartOffset(), stringLength, aDuration,
+                                        ADurationParseOption.All);
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         aDuration.getMonths(), aDuration.getMilliseconds(), false);
                             } else {
@@ -164,11 +157,11 @@ public class AIntervalStartFromDateConstructorDescriptor extends AbstractScalarF
                             intervalEnd = GregorianCalendarSystem.getChrononInDays(intervalEnd);
 
                             if (intervalEnd < intervalStart) {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": interval end must not be less than the interval start.");
+                                throw new AlgebricksException(
+                                        FID.getName() + ": interval end must not be less than the interval start.");
                             }
 
-                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.DATE.serialize());
+                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.SERIALIZED_DATE_TYPE_TAG);
                             intervalSerde.serialize(aInterval, out);
 
                         } catch (IOException e1) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
index 3ad1cc3..3588c7c 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromDateTimeConstructorDescriptor.java
@@ -53,17 +53,10 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
     public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_DATETIME;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_DATETIME_TYPE_TAG = ATypeTag.DATETIME.serialize();
-    private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
-    private final static byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
-    private final static byte SER_YEAR_MONTH_DURATION_TYPE_TAG = ATypeTag.YEARMONTHDURATION.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AIntervalStartFromDateTimeConstructorDescriptor();
         }
@@ -106,17 +99,17 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
 
                         try {
 
-                            if (argOut0.getByteArray()[0] == SER_NULL_TYPE_TAG
-                                    || argOut1.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                                    || argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             }
 
                             long intervalStart = 0, intervalEnd = 0;
 
-                            if (argOut0.getByteArray()[0] == SER_DATETIME_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_DATETIME_TYPE_TAG) {
                                 intervalStart = ADateTimeSerializerDeserializer.getChronon(argOut0.getByteArray(), 1);
-                            } else if (argOut0.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 utf8Ptr.set(argOut0.getByteArray(), 1, argOut0.getLength() - 1);
 
                                 int stringLength = utf8Ptr.getUTF8Length();
@@ -134,8 +127,8 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
                                     }
                                 }
 
-                                intervalStart = ADateParserFactory
-                                        .parseDatePart(argOut0.getByteArray(), startOffset, timeOffset);
+                                intervalStart = ADateParserFactory.parseDatePart(argOut0.getByteArray(), startOffset,
+                                        timeOffset);
                                 intervalStart += ATimeParserFactory.parseTimePart(argOut0.getByteArray(),
                                         startOffset + timeOffset + 1, stringLength - timeOffset - 1);
                             } else {
@@ -144,29 +137,28 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
                                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(argOut0.getByteArray()[0]));
                             }
 
-                            if (argOut1.getByteArray()[0] == SER_DURATION_TYPE_TAG) {
+                            if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         ADurationSerializerDeserializer.getYearMonth(argOut1.getByteArray(), 1),
                                         ADurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1), false);
-                            } else if (argOut1.getByteArray()[0] == SER_YEAR_MONTH_DURATION_TYPE_TAG) {
-                                intervalEnd = DurationArithmeticOperations
-                                        .addDuration(
-                                                intervalStart,
-                                                AYearMonthDurationSerializerDeserializer.getYearMonth(
-                                                        argOut1.getByteArray(), 1), 0, false);
-                            } else if (argOut1.getByteArray()[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_YEAR_MONTH_DURATION_TYPE_TAG) {
+                                intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
+                                        AYearMonthDurationSerializerDeserializer.getYearMonth(argOut1.getByteArray(),
+                                                1),
+                                        0, false);
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DAY_TIME_DURATION_TYPE_TAG) {
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart, 0,
                                         ADayTimeDurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1),
                                         false);
-                            } else if (argOut1.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
 
                                 // duration
                                 utf8Ptr.set(argOut1.getByteArray(), 1, argOut1.getLength() - 1);
                                 int stringLength = utf8Ptr.getUTF8Length();
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), utf8Ptr.getCharStartOffset(),
-                                                stringLength, aDuration, ADurationParseOption.All);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(),
+                                        utf8Ptr.getCharStartOffset(), stringLength, aDuration,
+                                        ADurationParseOption.All);
 
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart,
                                         aDuration.getMonths(), aDuration.getMilliseconds(), false);
@@ -177,11 +169,11 @@ public class AIntervalStartFromDateTimeConstructorDescriptor extends AbstractSca
                             }
 
                             if (intervalEnd < intervalStart) {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": interval end must not be less than the interval start.");
+                                throw new AlgebricksException(
+                                        FID.getName() + ": interval end must not be less than the interval start.");
                             }
 
-                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.DATETIME.serialize());
+                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.SERIALIZED_DATETIME_TYPE_TAG);
                             intervalSerde.serialize(aInterval, out);
 
                         } catch (IOException e1) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
index 3474ed6..78cdae2 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AIntervalStartFromTimeConstructorDescriptor.java
@@ -52,16 +52,10 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
     public final static FunctionIdentifier FID = AsterixBuiltinFunctions.INTERVAL_CONSTRUCTOR_START_FROM_TIME;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_TIME_TYPE_TAG = ATypeTag.TIME.serialize();
-    private final static byte SER_DURATION_TYPE_TAG = ATypeTag.DURATION.serialize();
-    private final static byte SER_DAY_TIME_DURATION_TYPE_TAG = ATypeTag.DAYTIMEDURATION.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AIntervalStartFromTimeConstructorDescriptor();
         }
@@ -104,24 +98,23 @@ public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarF
 
                         try {
 
-                            if (argOut0.getByteArray()[0] == SER_NULL_TYPE_TAG
-                                    || argOut1.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                                    || argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                                 return;
                             }
 
                             long intervalStart = 0, intervalEnd = 0;
 
-                            if (argOut0.getByteArray()[0] == SER_TIME_TYPE_TAG) {
+                            if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_TIME_TYPE_TAG) {
                                 intervalStart = ATimeSerializerDeserializer.getChronon(argOut0.getByteArray(), 1);
-                            } else if (argOut0.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut0.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 utf8Ptr.set(argOut0.getByteArray(), 1, argOut0.getLength() - 1);
 
                                 int stringLength = utf8Ptr.getUTF8Length();
 
-                                intervalStart = ATimeParserFactory
-                                        .parseTimePart(argOut0.getByteArray(), utf8Ptr.getCharStartOffset(),
-                                                stringLength);
+                                intervalStart = ATimeParserFactory.parseTimePart(argOut0.getByteArray(),
+                                        utf8Ptr.getCharStartOffset(), stringLength);
                             } else {
                                 throw new AlgebricksException(FID.getName()
                                         + ": expects NULL/STRING/TIME for the first argument, but got "
@@ -132,35 +125,35 @@ public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarF
                                 intervalStart += GregorianCalendarSystem.CHRONON_OF_DAY;
                             }
 
-                            if (argOut1.getByteArray()[0] == SER_DURATION_TYPE_TAG) {
+                            if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DURATION_TYPE_TAG) {
 
                                 if (ADurationSerializerDeserializer.getYearMonth(argOut1.getByteArray(), 1) != 0) {
-                                    throw new AlgebricksException(FID.getName()
-                                            + ": cannot add a year-month duration to a time value.");
+                                    throw new AlgebricksException(
+                                            FID.getName() + ": cannot add a year-month duration to a time value.");
                                 }
 
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart, 0,
                                         ADurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1), false);
 
-                            } else if (argOut1.getByteArray()[0] == SER_DAY_TIME_DURATION_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_DAY_TIME_DURATION_TYPE_TAG) {
 
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart, 0,
                                         ADayTimeDurationSerializerDeserializer.getDayTime(argOut1.getByteArray(), 1),
                                         false);
 
-                            } else if (argOut1.getByteArray()[0] == SER_STRING_TYPE_TAG) {
+                            } else if (argOut1.getByteArray()[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 // duration
 
                                 utf8Ptr.set(argOut1.getByteArray(), 1, argOut1.getLength() - 1);
                                 int stringLength = utf8Ptr.getUTF8Length();
 
-                                ADurationParserFactory
-                                        .parseDuration(argOut1.getByteArray(), utf8Ptr.getCharStartOffset(),
-                                                stringLength, aDuration, ADurationParseOption.All);
+                                ADurationParserFactory.parseDuration(argOut1.getByteArray(),
+                                        utf8Ptr.getCharStartOffset(), stringLength, aDuration,
+                                        ADurationParseOption.All);
 
                                 if (aDuration.getMonths() != 0) {
-                                    throw new AlgebricksException(FID.getName()
-                                            + ": cannot add a year-month duration to a time value.");
+                                    throw new AlgebricksException(
+                                            FID.getName() + ": cannot add a year-month duration to a time value.");
                                 }
 
                                 intervalEnd = DurationArithmeticOperations.addDuration(intervalStart, 0,
@@ -174,11 +167,11 @@ public class AIntervalStartFromTimeConstructorDescriptor extends AbstractScalarF
                             }
 
                             if (intervalEnd < intervalStart) {
-                                throw new AlgebricksException(FID.getName()
-                                        + ": interval end must not be less than the interval start.");
+                                throw new AlgebricksException(
+                                        FID.getName() + ": interval end must not be less than the interval start.");
                             }
 
-                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.TIME.serialize());
+                            aInterval.setValue(intervalStart, intervalEnd, ATypeTag.SERIALIZED_TIME_TYPE_TAG);
                             intervalSerde.serialize(aInterval, out);
 
                         } catch (IOException e1) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
index bafb778..44e09ce 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ALineConstructorDescriptor.java
@@ -45,9 +45,8 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ALineConstructorDescriptor();
         }
@@ -84,8 +83,8 @@ public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 String s = utf8Ptr.toString();
                                 int commaIndex = s.indexOf(',');
                                 int spaceIndex = s.indexOf(' ', commaIndex + 1);
@@ -96,7 +95,7 @@ public class ALineConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                                         Double.parseDouble(s.substring(commaIndex + 1, s.length())));
                                 aLine.setValue(aPoint[0], aPoint[1]);
                                 lineSerde.serialize(aLine, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
index 4b204f4..15779b5 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ANullConstructorDescriptor.java
@@ -42,10 +42,9 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 import org.apache.hyracks.util.string.UTF8StringUtil;
 
 public class ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ANullConstructorDescriptor();
         }
@@ -78,8 +77,9 @@ public class ANullConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                if (utf8BinaryComparator.compare(serString, 1, outInput.getLength(), NULL, 0, NULL.length) == 0) {
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                if (utf8BinaryComparator.compare(serString, 1, outInput.getLength(), NULL, 0,
+                                        NULL.length) == 0) {
                                     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/constructors/APoint3DConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
index 97bcd02..f1004bc 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APoint3DConstructorDescriptor.java
@@ -44,9 +44,8 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new APoint3DConstructorDescriptor();
         }
@@ -82,8 +81,8 @@ public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamic
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 String s = utf8Ptr.toString();
                                 int firstCommaIndex = s.indexOf(',');
                                 int secondCommaIndex = s.indexOf(',', firstCommaIndex + 1);
@@ -92,7 +91,7 @@ public class APoint3DConstructorDescriptor extends AbstractScalarFunctionDynamic
                                         Double.parseDouble(s.substring(secondCommaIndex + 1, s.length())));
                                 point3DSerde.serialize(aPoint3D, out);
 
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
index 49781d5..43882c9 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APointConstructorDescriptor.java
@@ -42,11 +42,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class APointConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new APointConstructorDescriptor();
         }
@@ -82,13 +80,13 @@ public class APointConstructorDescriptor extends AbstractScalarFunctionDynamicDe
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 String s = utf8Ptr.toString();
                                 aPoint.setValue(Double.parseDouble(s.substring(0, s.indexOf(','))),
                                         Double.parseDouble(s.substring(s.indexOf(',') + 1, s.length())));
                                 pointSerde.serialize(aPoint, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
index 4fb24a5..4b91e18 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/APolygonConstructorDescriptor.java
@@ -41,12 +41,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class APolygonConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_POLYGON_TYPE_TAG = ATypeTag.POLYGON.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new APolygonConstructorDescriptor();
         }
@@ -78,18 +75,18 @@ public class APolygonConstructorDescriptor extends AbstractScalarFunctionDynamic
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 String s = utf8Ptr.toString();
                                 String[] points = s.split(" ");
                                 if (points.length <= 2)
                                     throw new AlgebricksException(errorMessage);
-                                out.writeByte(SER_POLYGON_TYPE_TAG);
+                                out.writeByte(ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
                                 out.writeShort(points.length);
                                 for (int i = 0; i < points.length; i++)
                                     APointSerializerDeserializer.serialize(Double.parseDouble(points[i].split(",")[0]),
                                             Double.parseDouble(points[i].split(",")[1]), out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
index cefa031..5ffa0af 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ARectangleConstructorDescriptor.java
@@ -43,11 +43,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ARectangleConstructorDescriptor();
         }
@@ -84,8 +82,8 @@ public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynam
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength() -1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 String s = utf8Ptr.toString();
                                 int commaIndex = s.indexOf(',');
                                 int spaceIndex = s.indexOf(' ', commaIndex + 1);
@@ -103,7 +101,7 @@ public class ARectangleConstructorDescriptor extends AbstractScalarFunctionDynam
                                             "Rectangle arugment must be either (bottom left point, top right point) or (top right point, bottom left point)");
                                 }
                                 rectangle2DSerde.serialize(aRectangle, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
index daa8ac0..1355ed5 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AStringConstructorDescriptor.java
@@ -51,6 +51,7 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
 
     private static final long serialVersionUID = 1L;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AStringConstructorDescriptor();
         }
@@ -111,8 +112,7 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
                                         break;
                                     }
                                     case DOUBLE: {
-                                        double d = ADoubleSerializerDeserializer.getDouble(outInput.getByteArray(),
-                                                1);
+                                        double d = ADoubleSerializerDeserializer.getDouble(outInput.getByteArray(), 1);
                                         builder.appendString(String.valueOf(d));
                                         break;
                                     }
@@ -122,13 +122,13 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
                                         break;
                                     }
                                     case BOOLEAN: {
-                                        boolean b = ABooleanSerializerDeserializer.getBoolean(
-                                                outInput.getByteArray(), 1);
+                                        boolean b = ABooleanSerializerDeserializer.getBoolean(outInput.getByteArray(),
+                                                1);
                                         builder.appendString(String.valueOf(b));
                                         break;
                                     }
 
-                                    // NotYetImplemented
+                                        // NotYetImplemented
                                     case CIRCLE:
                                     case DATE:
                                     case DATETIME:
@@ -150,7 +150,7 @@ public class AStringConstructorDescriptor extends AbstractScalarFunctionDynamicD
                                         throw new AlgebricksException("string of " + tt + " not supported");
                                 }
                                 builder.finish();
-                                out.write(ATypeTag.STRING.serialize());
+                                out.write(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
                                 out.write(baaos.getByteArray(), 0, baaos.getLength());
                             }
                         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
index db8f854..acfc1d0 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/ATimeConstructorDescriptor.java
@@ -44,12 +44,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new ATimeConstructorDescriptor();
         }
@@ -85,9 +82,9 @@ public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
 
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 int stringLength = utf8Ptr.getUTF8Length();
                                 int startOffset = utf8Ptr.getCharStartOffset();
 
@@ -98,7 +95,8 @@ public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                                             + stringLength);
                                 }
 
-                                int chrononTimeInMs = ATimeParserFactory.parseTimePart(serString, startOffset, stringLength);
+                                int chrononTimeInMs = ATimeParserFactory.parseTimePart(serString, startOffset,
+                                        stringLength);
 
                                 if (chrononTimeInMs < 0) {
                                     chrononTimeInMs += GregorianCalendarSystem.CHRONON_OF_DAY;
@@ -107,7 +105,7 @@ public class ATimeConstructorDescriptor extends AbstractScalarFunctionDynamicDes
                                 aTime.setValue(chrononTimeInMs);
                                 timeSerde.serialize(aTime, out);
 
-                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
index 6edd393..c7168c4 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AUUIDFromStringConstructorDescriptor.java
@@ -47,11 +47,9 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
  * uuid("02a199ca-bf58-412e-bd9f-60a0c975a8ac"))
  */
 public class AUUIDFromStringConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AUUIDFromStringConstructorDescriptor();
         }
@@ -90,8 +88,8 @@ public class AUUIDFromStringConstructorDescriptor extends AbstractScalarFunction
                             outInput.reset();
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
-                                utf8Ptr.set(serString, 1, outInput.getLength()-1);
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                                utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 msb = 0;
                                 lsb = 0;
                                 tmpLongValue = 0;
@@ -138,7 +136,7 @@ public class AUUIDFromStringConstructorDescriptor extends AbstractScalarFunction
                                 aUUID.setValue(msb, lsb);
                                 uuidSerde.serialize(aUUID, out);
 
-                            } else if (serString[0] == SER_NULL_TYPE_TAG)
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG)
                                 nullSerde.serialize(ANull.NULL, out);
                             else
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
index 3b9c006..ed193d6 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AYearMonthDurationConstructorDescriptor.java
@@ -43,11 +43,7 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AYearMonthDurationConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
 
         @Override
@@ -86,16 +82,15 @@ public class AYearMonthDurationConstructorDescriptor extends AbstractScalarFunct
                             eval.evaluate(tuple);
                             byte[] serString = outInput.getByteArray();
 
-                            if (serString[0] == SER_STRING_TYPE_TAG) {
+                            if (serString[0] == ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                                 utf8Ptr.set(serString, 1, outInput.getLength() - 1);
                                 int stringLength = utf8Ptr.getUTF8Length();
 
-                                ADurationParserFactory
-                                        .parseDuration(serString, utf8Ptr.getCharStartOffset(), stringLength,
-                                                aYearMonthDuration, ADurationParseOption.YEAR_MONTH);
+                                ADurationParserFactory.parseDuration(serString, utf8Ptr.getCharStartOffset(),
+                                        stringLength, aYearMonthDuration, ADurationParseOption.YEAR_MONTH);
 
                                 yearMonthDurationSerde.serialize(aYearMonthDuration, out);
-                            } else if (serString[0] == SER_NULL_TYPE_TAG) {
+                            } else if (serString[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 nullSerde.serialize(ANull.NULL, out);
                             } else {
                                 throw new AlgebricksException(errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
index 2a7348c..6117452 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/OpenRecordConstructorDescriptor.java
@@ -41,6 +41,7 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class OpenRecordConstructorDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new OpenRecordConstructorDescriptor();
         }
@@ -99,7 +100,7 @@ public class OpenRecordConstructorDescriptor extends AbstractScalarFunctionDynam
                                     evalNames[i].evaluate(tuple);
                                     recBuilder.addField(fieldNameBuffer, fieldValueBuffer);
                                 } else {
-                                    if (fieldValueBuffer.getByteArray()[0] != ATypeTag.NULL.serialize()) {
+                                    if (fieldValueBuffer.getByteArray()[0] != ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                         recBuilder.addField(closedFieldId, fieldValueBuffer);
                                     }
                                     closedFieldId++;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
index 0e45417..a6f9183 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractBinaryStringBoolEval.java
@@ -37,13 +37,7 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public abstract class AbstractBinaryStringBoolEval implements ICopyEvaluator {
-
     private DataOutput dout;
-
-    // allowed input types
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
-
     private ArrayBackedValueStorage array0 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array1 = new ArrayBackedValueStorage();
     private ICopyEvaluator evalLeft;
@@ -77,11 +71,12 @@ public abstract class AbstractBinaryStringBoolEval implements ICopyEvaluator {
         evalRight.evaluate(tuple);
 
         try {
-            if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG || array1.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+            if (array0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                 nullSerde.serialize(ANull.NULL, dout);
                 return;
-            } else if (array0.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array1.getByteArray()[0] != SER_STRING_TYPE_TAG) {
+            } else if (array0.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array1.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                 throw new AlgebricksException(funcID.getName() + ": expects input type STRING or NULL, but got "
                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + " and "
                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[0]) + ")!");

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
index 7dbc99a..a08551f 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractQuadStringStringEval.java
@@ -43,8 +43,6 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public abstract class AbstractQuadStringStringEval implements ICopyEvaluator {
 
     private DataOutput dout;
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private ArrayBackedValueStorage array0 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array1 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array2 = new ArrayBackedValueStorage();
@@ -71,7 +69,7 @@ public abstract class AbstractQuadStringStringEval implements ICopyEvaluator {
 
     public AbstractQuadStringStringEval(DataOutput dout, ICopyEvaluatorFactory eval0, ICopyEvaluatorFactory eval1,
             ICopyEvaluatorFactory eval2, ICopyEvaluatorFactory eval3, FunctionIdentifier funcID)
-            throws AlgebricksException {
+                    throws AlgebricksException {
         this.dout = dout;
         this.eval0 = eval0.createEvaluator(array0);
         this.eval1 = eval1.createEvaluator(array1);
@@ -93,14 +91,16 @@ public abstract class AbstractQuadStringStringEval implements ICopyEvaluator {
         eval3.evaluate(tuple);
 
         try {
-            if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG || array1.getByteArray()[0] == SER_NULL_TYPE_TAG
-                    || array2.getByteArray()[0] == SER_NULL_TYPE_TAG || array3.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+            if (array0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array2.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array3.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                 nullSerde.serialize(ANull.NULL, dout);
                 return;
-            } else if (array0.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array1.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array2.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array3.getByteArray()[0] != SER_STRING_TYPE_TAG) {
+            } else if (array0.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array1.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array2.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array3.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
                 throw new AlgebricksException(funcID.getName()
                         + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL, STRING/NULL), but got ("
                         + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + ", "
@@ -127,7 +127,6 @@ public abstract class AbstractQuadStringStringEval implements ICopyEvaluator {
     }
 
     protected abstract String compute(UTF8StringPointable strPtr1st, UTF8StringPointable strPtr2nd,
-            UTF8StringPointable strPtr3rd,
-            UTF8StringPointable strPtr4th) throws AlgebricksException;
+            UTF8StringPointable strPtr3rd, UTF8StringPointable strPtr4th) throws AlgebricksException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
index f966c1c..eb32ac2 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringBoolEval.java
@@ -39,8 +39,6 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public abstract class AbstractTripleStringBoolEval implements ICopyEvaluator {
 
     private DataOutput dout;
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private ArrayBackedValueStorage array0 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array1 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array2 = new ArrayBackedValueStorage();
@@ -80,19 +78,21 @@ public abstract class AbstractTripleStringBoolEval implements ICopyEvaluator {
         eval2.evaluate(tuple);
 
         try {
-            if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG || array1.getByteArray()[0] == SER_NULL_TYPE_TAG
-                    || array2.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+            if (array0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array2.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                 nullSerde.serialize(ANull.NULL, dout);
                 return;
             }
 
-            if (array0.getByteArray()[0] != SER_STRING_TYPE_TAG || array1.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array2.getByteArray()[0] != SER_STRING_TYPE_TAG) {
-                throw new AlgebricksException(funcID.getName()
-                        + ": expects iput type (STRING/NULL, STRING/NULL, STRING) but got ("
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + ", "
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[0]) + ", "
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[0]) + ")");
+            if (array0.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array1.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array2.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                throw new AlgebricksException(
+                        funcID.getName() + ": expects iput type (STRING/NULL, STRING/NULL, STRING) but got ("
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + ", "
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[0]) + ", "
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[0]) + ")");
             }
 
         } catch (HyracksDataException e) {
@@ -103,8 +103,7 @@ public abstract class AbstractTripleStringBoolEval implements ICopyEvaluator {
         strPtr2nd.set(array1.getByteArray(), array1.getStartOffset() + 1, array1.getLength());
         strPtr3rd.set(array2.getByteArray(), array2.getStartOffset() + 1, array2.getLength());
 
-        ABoolean res = compute(strPtr1st, strPtr2nd, strPtr3rd) ? ABoolean.TRUE
-                : ABoolean.FALSE;
+        ABoolean res = compute(strPtr1st, strPtr2nd, strPtr3rd) ? ABoolean.TRUE : ABoolean.FALSE;
         try {
             boolSerde.serialize(res, dout);
         } catch (HyracksDataException e) {

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
index 9e79832..bc602c3 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AbstractTripleStringStringEval.java
@@ -37,10 +37,7 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public abstract class AbstractTripleStringStringEval implements ICopyEvaluator {
-
     private DataOutput dout;
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-    private final static byte SER_STRING_TYPE_TAG = ATypeTag.STRING.serialize();
     private ArrayBackedValueStorage array0 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array1 = new ArrayBackedValueStorage();
     private ArrayBackedValueStorage array2 = new ArrayBackedValueStorage();
@@ -82,18 +79,19 @@ public abstract class AbstractTripleStringStringEval implements ICopyEvaluator {
         eval2.evaluate(tuple);
 
         try {
-            if (array0.getByteArray()[0] == SER_NULL_TYPE_TAG || array1.getByteArray()[0] == SER_NULL_TYPE_TAG
-                    || array2.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+            if (array0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                    || array2.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                 nullSerde.serialize(ANull.NULL, dout);
                 return;
-            } else if (array0.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array1.getByteArray()[0] != SER_STRING_TYPE_TAG
-                    || array2.getByteArray()[0] != SER_STRING_TYPE_TAG) {
-                throw new AlgebricksException(funcID.getName()
-                        + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL), but got ("
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + ", "
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[0]) + ", "
-                        + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[0]) + ".");
+            } else if (array0.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array1.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG
+                    || array2.getByteArray()[0] != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
+                throw new AlgebricksException(
+                        funcID.getName() + ": expects input type (STRING/NULL, STRING/NULL, STRING/NULL), but got ("
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array0.getByteArray()[0]) + ", "
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array1.getByteArray()[0]) + ", "
+                                + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(array2.getByteArray()[0]) + ".");
             }
         } catch (HyracksDataException 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/functions/AndDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java
index 9388f93..e310953 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AndDescriptor.java
@@ -39,11 +39,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class AndDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-    private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AndDescriptor();
         }
@@ -86,7 +84,7 @@ public class AndDescriptor extends AbstractScalarFunctionDynamicDescriptor {
                             for (int i = 0; i < n; i++) {
                                 argOut.reset();
                                 evals[i].evaluate(tuple);
-                                if (argOut.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+                                if (argOut.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                     metNull = true;
                                     continue;
                                 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
index 885c7f0..bc5d26c 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
@@ -47,6 +47,7 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
 
     private static final long serialVersionUID = 1L;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new AnyCollectionMemberDescriptor();
         }
@@ -65,11 +66,7 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
     private static class AnyCollectionMemberEvalFactory implements ICopyEvaluatorFactory {
 
         private static final long serialVersionUID = 1L;
-
         private ICopyEvaluatorFactory listEvalFactory;
-        private final static byte SER_ORDEREDLIST_TYPE_TAG = ATypeTag.ORDEREDLIST.serialize();
-        private final static byte SER_UNORDEREDLIST_TYPE_TAG = ATypeTag.UNORDEREDLIST.serialize();
-        private final static byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
         private byte serItemTypeTag;
         private ATypeTag itemTag;
         private boolean selfDescList = false;
@@ -99,26 +96,27 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
                         evalList.evaluate(tuple);
                         byte[] serList = outInputList.getByteArray();
 
-                        if (serList[0] == SER_NULL_TYPE_TAG) {
+                        if (serList[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                             nullSerde.serialize(ANull.NULL, out);
                             return;
                         }
 
-                        if (serList[0] != SER_ORDEREDLIST_TYPE_TAG && serList[0] != SER_UNORDEREDLIST_TYPE_TAG) {
+                        if (serList[0] != ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG
+                                && serList[0] != ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG) {
                             throw new AlgebricksException(AsterixBuiltinFunctions.ANY_COLLECTION_MEMBER.getName()
                                     + ": expects input type ORDEREDLIST/UNORDEREDLIST, but got "
                                     + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[0]));
                         }
 
-                        if (serList[0] == SER_ORDEREDLIST_TYPE_TAG) {
+                        if (serList[0] == ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG) {
                             if (AOrderedListSerializerDeserializer.getNumberOfItems(serList) == 0) {
-                                out.writeByte(SER_NULL_TYPE_TAG);
+                                out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
                                 return;
                             }
                             itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, 0);
                         } else {
                             if (AUnorderedListSerializerDeserializer.getNumberOfItems(serList) == 0) {
-                                out.writeByte(SER_NULL_TYPE_TAG);
+                                out.writeByte(ATypeTag.SERIALIZED_NULL_TYPE_TAG);
                                 return;
                             }
                             itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, 0);
@@ -132,7 +130,8 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
 
                         if (selfDescList) {
                             itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[itemOffset]);
-                            itemLength = NonTaggedFormatUtil.getFieldValueLength(serList, itemOffset, itemTag, true) + 1;
+                            itemLength = NonTaggedFormatUtil.getFieldValueLength(serList, itemOffset, itemTag, true)
+                                    + 1;
                             out.write(serList, itemOffset, itemLength);
                         } else {
                             itemLength = NonTaggedFormatUtil.getFieldValueLength(serList, itemOffset, itemTag, false);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
index 3b89eba..6e46a23 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
@@ -43,6 +43,7 @@ public class CodePointToStringDescriptor extends AbstractScalarFunctionDynamicDe
 
     private static final long serialVersionUID = 1L;
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new CodePointToStringDescriptor();
         }
@@ -65,7 +66,7 @@ public class CodePointToStringDescriptor extends AbstractScalarFunctionDynamicDe
 
                     private final byte[] currentUTF8 = new byte[6];
                     private final byte[] tempStoreForLength = new byte[5];
-                    private final byte stringTypeTag = ATypeTag.STRING.serialize();
+                    private final byte stringTypeTag = ATypeTag.SERIALIZED_STRING_TYPE_TAG;
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
@@ -97,21 +98,21 @@ public class CodePointToStringDescriptor extends AbstractScalarFunctionDynamicDe
                                 // calculate length first
                                 int utf_8_len = 0;
                                 for (int i = 0; i < size; i++) {
-                                    int itemOffset = AOrderedListSerializerDeserializer
-                                            .getItemOffset(serOrderedList, i);
+                                    int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serOrderedList,
+                                            i);
                                     int codePoint = 0;
-                                    codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                                            serOrderedList, itemOffset, 1);
+                                    codePoint = ATypeHierarchy
+                                            .getIntegerValueWithDifferentTypeTagPosition(serOrderedList, itemOffset, 1);
                                     utf_8_len += UTF8StringUtil.codePointToUTF8(codePoint, currentUTF8);
                                 }
                                 out.writeByte(stringTypeTag);
                                 UTF8StringUtil.writeUTF8Length(utf_8_len, tempStoreForLength, out);
                                 for (int i = 0; i < size; i++) {
-                                    int itemOffset = AOrderedListSerializerDeserializer
-                                            .getItemOffset(serOrderedList, i);
+                                    int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serOrderedList,
+                                            i);
                                     int codePoint = 0;
-                                    codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                                            serOrderedList, itemOffset, 1);
+                                    codePoint = ATypeHierarchy
+                                            .getIntegerValueWithDifferentTypeTagPosition(serOrderedList, itemOffset, 1);
                                     utf_8_len = UTF8StringUtil.codePointToUTF8(codePoint, currentUTF8);
                                     for (int j = 0; j < utf_8_len; j++) {
                                         out.writeByte(currentUTF8[j]);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/5dc958ce/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
----------------------------------------------------------------------
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePointDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
index 791e2ee..7311e90 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePointDescriptor.java
@@ -43,14 +43,9 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 
 public class CreatePointDescriptor extends AbstractScalarFunctionDynamicDescriptor {
-
     private static final long serialVersionUID = 1L;
-
-    // allowed input type
-    private static final byte SER_DOUBLE_TYPE_TAG = ATypeTag.DOUBLE.serialize();
-    private static final byte SER_NULL_TYPE_TAG = ATypeTag.NULL.serialize();
-
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
+        @Override
         public IFunctionDescriptor createFunctionDescriptor() {
             return new CreatePointDescriptor();
         }
@@ -84,19 +79,23 @@ public class CreatePointDescriptor extends AbstractScalarFunctionDynamicDescript
                         eval1.evaluate(tuple);
 
                         // type-check: (double, double)
-                        if ((outInput0.getByteArray()[0] != SER_DOUBLE_TYPE_TAG && outInput0.getByteArray()[0] != SER_NULL_TYPE_TAG)
-                                || (outInput1.getByteArray()[0] != SER_DOUBLE_TYPE_TAG && outInput1.getByteArray()[0] != SER_NULL_TYPE_TAG)) {
-                            throw new AlgebricksException(AsterixBuiltinFunctions.CREATE_POINT.getName()
-                                    + ": expects input type: (DOUBLE, DOUBLE) but got ("
-                                    + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput0.getByteArray()[0])
-                                    + ", "
-                                    + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(outInput1.getByteArray()[0])
-                                    + ").");
+                        if ((outInput0.getByteArray()[0] != ATypeTag.SERIALIZED_DOUBLE_TYPE_TAG
+                                && outInput0.getByteArray()[0] != ATypeTag.SERIALIZED_NULL_TYPE_TAG)
+                                || (outInput1.getByteArray()[0] != ATypeTag.SERIALIZED_DOUBLE_TYPE_TAG
+                                        && outInput1.getByteArray()[0] != ATypeTag.SERIALIZED_NULL_TYPE_TAG)) {
+                            throw new AlgebricksException(
+                                    AsterixBuiltinFunctions.CREATE_POINT.getName()
+                                            + ": expects input type: (DOUBLE, DOUBLE) but got ("
+                                            + EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(
+                                                    outInput0.getByteArray()[0])
+                                            + ", " + EnumDeserializer.ATYPETAGDESERIALIZER
+                                                    .deserialize(outInput1.getByteArray()[0])
+                                            + ").");
                         }
 
                         try {
-                            if (outInput0.getByteArray()[0] == SER_NULL_TYPE_TAG
-                                    || outInput1.getByteArray()[0] == SER_NULL_TYPE_TAG) {
+                            if (outInput0.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG
+                                    || outInput1.getByteArray()[0] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) {
                                 AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL)
                                         .serialize(ANull.NULL, out);
                             } else {


Mime
View raw message