asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [2/2] asterixdb git commit: Clean up exceptions in runtime functions.
Date Fri, 09 Jun 2017 05:33:21 GMT
Clean up exceptions in runtime functions.

Change-Id: Ie08d6de31d9e928e888137680d9c7af5d66b85ae
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1814
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/81799ab0
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/81799ab0
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/81799ab0

Branch: refs/heads/master
Commit: 81799ab0fa75b7b156a9d0297389d7d4a17e60d9
Parents: 0832322
Author: Yingyi Bu <yingyi@couchbase.com>
Authored: Thu Jun 8 16:21:38 2017 -0700
Committer: Yingyi Bu <buyingyi@gmail.com>
Committed: Thu Jun 8 22:32:58 2017 -0700

----------------------------------------------------------------------
 .../asterix/common/exceptions/ErrorCode.java    |  1 +
 .../main/resources/asx_errormsg/en.properties   |  1 +
 .../common/AOrderedListBinaryTokenizer.java     |  6 +-
 .../common/AUnorderedListBinaryTokenizer.java   |  4 +-
 .../AOrderedListSerializerDeserializer.java     | 23 +++---
 .../AUnorderedListSerializerDeserializer.java   | 23 +++---
 .../pointables/nonvisitor/AListPointable.java   | 13 +--
 .../pointables/nonvisitor/ARecordPointable.java |  5 +-
 .../asterix/om/utils/NonTaggedFormatUtil.java   |  7 +-
 .../common/AbstractAsterixListIterator.java     | 33 +++-----
 .../runtime/evaluators/common/ListAccessor.java |  9 +--
 .../evaluators/common/OrderedListIterator.java  |  4 +-
 .../SimilarityJaccardPrefixEvaluator.java       | 81 ++++++-------------
 .../common/UnorderedListIterator.java           |  4 +-
 .../AnyCollectionMemberDescriptor.java          | 14 ++--
 .../functions/CodePointToStringDescriptor.java  | 56 ++++++-------
 .../functions/CreatePolygonDescriptor.java      | 84 +++++++++-----------
 .../evaluators/functions/GetItemDescriptor.java | 22 +++--
 .../functions/SimilarityDescriptor.java         | 57 +++++--------
 .../functions/StringConcatDescriptor.java       | 83 +++++++++----------
 .../functions/StringJoinDescriptor.java         | 13 ++-
 .../binary/BinaryConcatDescriptor.java          | 13 ++-
 .../records/FieldAccessByIndexEvalFactory.java  | 15 ++--
 .../records/FieldAccessByNameEvalFactory.java   |  7 +-
 .../records/FieldAccessNestedEvalFactory.java   | 35 ++++----
 .../records/GetRecordFieldValueEvalFactory.java | 20 +++--
 .../std/FlushDatasetOperatorDescriptor.java     |  2 +-
 .../std/NoTupleSourceRuntimeFactory.java        | 52 ------------
 .../std/ScanCollectionDescriptor.java           |  7 +-
 .../std/SubsetCollectionDescriptor.java         | 12 +--
 30 files changed, 277 insertions(+), 429 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index df647d5..912ac37 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -62,6 +62,7 @@ public class ErrorCode {
     public static final int TYPE_CONVERT_INTEGER_SOURCE = 19;
     public static final int TYPE_CONVERT_INTEGER_TARGET = 20;
     public static final int TYPE_CONVERT_OUT_OF_BOUND = 21;
+    public static final int FIELD_SHOULD_BE_TYPED = 22;
     public static final int INSTANTIATION_ERROR = 100;
 
     // Compilation errors

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 7204e34..9efb6b8 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -55,6 +55,7 @@
 19 = Can't convert integer types. The source type should be one of %1$s.
 20 = Can't convert integer types. The target type should be one of %1$s.
 21 = Source value %1$s is out of range that %2$s can hold - %2$s.MAX_VALUE: %3$s, %2$s.MIN_VALUE: %4$s
+22 = The accessed field is untyped, but should be typed
 100 = Unable to instantiate class %1$s
 
 # Compile-time check errors

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AOrderedListBinaryTokenizer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AOrderedListBinaryTokenizer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AOrderedListBinaryTokenizer.java
index 90af41b..c644bbe 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AOrderedListBinaryTokenizer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AOrderedListBinaryTokenizer.java
@@ -18,11 +18,11 @@
  */
 package org.apache.asterix.dataflow.data.common;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizer;
 import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IToken;
 import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.ITokenFactory;
@@ -64,7 +64,7 @@ public class AOrderedListBinaryTokenizer implements IBinaryTokenizer {
             length = NonTaggedFormatUtil.getFieldValueLength(data, itemOffset, typeTag, false);
             // Last param is a hack to pass the type tag.
             token.reset(data, itemOffset, itemOffset + length, length, data[start + 1]);
-        } catch (AsterixException e) {
+        } catch (HyracksDataException e) {
             throw new IllegalStateException(e);
         }
         itemIndex++;
@@ -79,7 +79,7 @@ public class AOrderedListBinaryTokenizer implements IBinaryTokenizer {
         this.itemIndex = 0;
     }
 
-    protected int getItemOffset(byte[] data, int start, int itemIndex) throws AsterixException {
+    protected int getItemOffset(byte[] data, int start, int itemIndex) throws HyracksDataException {
         return AOrderedListSerializerDeserializer.getItemOffset(data, start, itemIndex);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AUnorderedListBinaryTokenizer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AUnorderedListBinaryTokenizer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AUnorderedListBinaryTokenizer.java
index b90e87f..6926713 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AUnorderedListBinaryTokenizer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AUnorderedListBinaryTokenizer.java
@@ -18,8 +18,8 @@
  */
 package org.apache.asterix.dataflow.data.common;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.ITokenFactory;
 
 public class AUnorderedListBinaryTokenizer extends AOrderedListBinaryTokenizer {
@@ -29,7 +29,7 @@ public class AUnorderedListBinaryTokenizer extends AOrderedListBinaryTokenizer {
     }
 
     @Override
-    protected int getItemOffset(byte[] data, int start, int itemIndex) throws AsterixException {
+    protected int getItemOffset(byte[] data, int start, int itemIndex) throws HyracksDataException {
         return AUnorderedListSerializerDeserializer.getItemOffset(data, start, itemIndex);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
index da95091..0a66d56 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AOrderedListSerializerDeserializer.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.asterix.builders.OrderedListBuilder;
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AOrderedList;
 import org.apache.asterix.om.base.IAObject;
@@ -42,7 +41,8 @@ import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
 public class AOrderedListSerializerDeserializer implements ISerializerDeserializer<AOrderedList> {
 
     private static final long serialVersionUID = 1L;
-    public static final AOrderedListSerializerDeserializer SCHEMALESS_INSTANCE = new AOrderedListSerializerDeserializer();
+    public static final AOrderedListSerializerDeserializer SCHEMALESS_INSTANCE =
+            new AOrderedListSerializerDeserializer();
 
     private final IAType itemType;
     @SuppressWarnings("rawtypes")
@@ -74,18 +74,19 @@ public class AOrderedListSerializerDeserializer implements ISerializerDeserializ
             ISerializerDeserializer currentDeserializer = deserializer;
             if (itemType.getTypeTag() == ATypeTag.ANY && typeTag != ATypeTag.ANY) {
                 currentItemType = TypeTagUtil.getBuiltinTypeByTag(typeTag);
-                currentDeserializer = SerializerDeserializerProvider.INSTANCE
-                        .getNonTaggedSerializerDeserializer(currentItemType);
+                currentDeserializer =
+                        SerializerDeserializerProvider.INSTANCE.getNonTaggedSerializerDeserializer(currentItemType);
             }
 
-            List<IAObject> items = new ArrayList<IAObject>();
+            List<IAObject> items = new ArrayList<>();
             in.readInt(); // list size
             int numberOfitems;
             numberOfitems = in.readInt();
             if (numberOfitems > 0) {
                 if (!NonTaggedFormatUtil.isFixedSizedCollection(currentItemType)) {
-                    for (int i = 0; i < numberOfitems; i++)
+                    for (int i = 0; i < numberOfitems; i++) {
                         in.readInt();
+                    }
                 }
                 for (int i = 0; i < numberOfitems; i++) {
                     IAObject v = (IAObject) currentDeserializer.deserialize(in);
@@ -119,14 +120,15 @@ public class AOrderedListSerializerDeserializer implements ISerializerDeserializ
     }
 
     public static int getNumberOfItems(byte[] serOrderedList, int offset) {
-        if (serOrderedList[offset] == ATypeTag.ARRAY.serialize())
+        if (serOrderedList[offset] == ATypeTag.ARRAY.serialize()) {
             // 6 = tag (1) + itemTag (1) + list size (4)
             return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 6);
-        else
+        } else {
             return -1;
+        }
     }
 
-    public static int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException {
+    public static int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws HyracksDataException {
         if (serOrderedList[offset] == ATypeTag.ARRAY.serialize()) {
             ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[offset + 1]);
             if (NonTaggedFormatUtil.isFixedSizedCollection(typeTag)) {
@@ -136,8 +138,9 @@ public class AOrderedListSerializerDeserializer implements ISerializerDeserializ
                 return offset + AInt32SerializerDeserializer.getInt(serOrderedList, offset + 10 + (4 * itemIndex));
             }
             // 10 = tag (1) + itemTag (1) + list size (4) + number of items (4)
-        } else
+        } else {
             return -1;
+        }
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
index dd95586..a6090af 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AUnorderedListSerializerDeserializer.java
@@ -23,7 +23,6 @@ import java.io.DataOutput;
 import java.util.ArrayList;
 
 import org.apache.asterix.builders.UnorderedListBuilder;
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AUnorderedList;
 import org.apache.asterix.om.base.IACursor;
@@ -43,7 +42,8 @@ public class AUnorderedListSerializerDeserializer implements ISerializerDeserial
 
     private static final long serialVersionUID = 1L;
 
-    public static final AUnorderedListSerializerDeserializer SCHEMALESS_INSTANCE = new AUnorderedListSerializerDeserializer();
+    public static final AUnorderedListSerializerDeserializer SCHEMALESS_INSTANCE =
+            new AUnorderedListSerializerDeserializer();
 
     private final IAType itemType;
     private final AUnorderedListType unorderedlistType;
@@ -76,18 +76,19 @@ public class AUnorderedListSerializerDeserializer implements ISerializerDeserial
             ISerializerDeserializer currentDeserializer = deserializer;
             if (itemType.getTypeTag() == ATypeTag.ANY && typeTag != ATypeTag.ANY) {
                 currentItemType = TypeTagUtil.getBuiltinTypeByTag(typeTag);
-                currentDeserializer = SerializerDeserializerProvider.INSTANCE
-                        .getNonTaggedSerializerDeserializer(currentItemType);
+                currentDeserializer =
+                        SerializerDeserializerProvider.INSTANCE.getNonTaggedSerializerDeserializer(currentItemType);
             }
 
             in.readInt(); // list size
             int numberOfitems;
             numberOfitems = in.readInt();
-            ArrayList<IAObject> items = new ArrayList<IAObject>();
+            ArrayList<IAObject> items = new ArrayList<>();
             if (numberOfitems > 0) {
                 if (!NonTaggedFormatUtil.isFixedSizedCollection(currentItemType)) {
-                    for (int i = 0; i < numberOfitems; i++)
+                    for (int i = 0; i < numberOfitems; i++) {
                         in.readInt();
+                    }
                 }
                 for (int i = 0; i < numberOfitems; i++) {
                     items.add((IAObject) currentDeserializer.deserialize(in));
@@ -121,14 +122,15 @@ public class AUnorderedListSerializerDeserializer implements ISerializerDeserial
     }
 
     public static int getNumberOfItems(byte[] serOrderedList, int offset) {
-        if (serOrderedList[offset] == ATypeTag.MULTISET.serialize())
+        if (serOrderedList[offset] == ATypeTag.MULTISET.serialize()) {
             // 6 = tag (1) + itemTag (1) + list size (4)
             return AInt32SerializerDeserializer.getInt(serOrderedList, offset + 6);
-        else
+        } else {
             return -1;
+        }
     }
 
-    public static int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException {
+    public static int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws HyracksDataException {
         if (serOrderedList[offset] == ATypeTag.MULTISET.serialize()) {
             ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[offset + 1]);
             if (NonTaggedFormatUtil.isFixedSizedCollection(typeTag)) {
@@ -138,8 +140,9 @@ public class AUnorderedListSerializerDeserializer implements ISerializerDeserial
                 return offset + AInt32SerializerDeserializer.getInt(serOrderedList, offset + 10 + (4 * itemIndex));
             }
             // 10 = tag (1) + itemTag (1) + list size (4) + number of items (4)
-        } else
+        } else {
             return -1;
+        }
     }
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
index f2e7299..7a2efe0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/AListPointable.java
@@ -29,6 +29,7 @@ import org.apache.asterix.om.types.AbstractCollectionType;
 import org.apache.asterix.om.util.container.IObjectFactory;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.data.std.api.AbstractPointable;
 import org.apache.hyracks.data.std.api.IPointable;
 import org.apache.hyracks.data.std.api.IPointableFactory;
@@ -123,7 +124,7 @@ public class AListPointable extends AbstractPointable {
         return NonTaggedFormatUtil.isFixedSizedCollection(inputType.getItemType());
     }
 
-    public int getFixedLength(AbstractCollectionType inputType) throws AsterixException {
+    public int getFixedLength(AbstractCollectionType inputType) throws HyracksDataException {
         return NonTaggedFormatUtil.getFieldValueLength(bytes, 0, inputType.getItemType().getTypeTag(), false);
     }
 
@@ -163,7 +164,7 @@ public class AListPointable extends AbstractPointable {
     // Item accessors
     // ----------------------
 
-    public int getItemOffset(AbstractCollectionType inputType, int index) throws AsterixException {
+    public int getItemOffset(AbstractCollectionType inputType, int index) throws HyracksDataException {
         if (isFixedType(inputType)) {
             return getItemCountOffset() + getItemCountSize() + index * getFixedLength(inputType);
         } else {
@@ -172,14 +173,14 @@ public class AListPointable extends AbstractPointable {
         }
     }
 
-    public byte getItemTag(AbstractCollectionType inputType, int index) throws AsterixException {
+    public byte getItemTag(AbstractCollectionType inputType, int index) throws HyracksDataException {
         if (getType() != ATypeTag.ANY.serialize()) {
             return getType();
         }
         return bytes[getItemOffset(inputType, index)];
     }
 
-    public int getItemSize(AbstractCollectionType inputType, int index) throws AsterixException {
+    public int getItemSize(AbstractCollectionType inputType, int index) throws HyracksDataException {
         if (isFixedType(inputType)) {
             return getFixedLength(inputType);
         } else {
@@ -188,8 +189,8 @@ public class AListPointable extends AbstractPointable {
         }
     }
 
-    public void getItemValue(AbstractCollectionType inputType, int index, DataOutput dOut) throws IOException,
-            AsterixException {
+    public void getItemValue(AbstractCollectionType inputType, int index, DataOutput dOut)
+            throws IOException, AsterixException {
         if (getType() != ATypeTag.ANY.serialize()) {
             dOut.writeByte(getType());
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
index 190a3b2..0aa256f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/nonvisitor/ARecordPointable.java
@@ -32,6 +32,7 @@ import org.apache.asterix.om.util.container.IObjectFactory;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
 import org.apache.asterix.om.utils.RecordUtil;
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.data.std.api.AbstractPointable;
 import org.apache.hyracks.data.std.api.IPointable;
 import org.apache.hyracks.data.std.api.IPointableFactory;
@@ -252,7 +253,7 @@ public class ARecordPointable extends AbstractPointable {
         return aType;
     }
 
-    public int getClosedFieldSize(ARecordType recordType, int fieldId) throws AsterixException {
+    public int getClosedFieldSize(ARecordType recordType, int fieldId) throws HyracksDataException {
         if (isClosedFieldNull(recordType, fieldId)) {
             return 0;
         }
@@ -294,7 +295,7 @@ public class ARecordPointable extends AbstractPointable {
         return getOpenFieldNameOffset(recordType, fieldId) + getOpenFieldNameSize(recordType, fieldId);
     }
 
-    public int getOpenFieldValueSize(ARecordType recordType, int fieldId) throws AsterixException {
+    public int getOpenFieldValueSize(ARecordType recordType, int fieldId) throws HyracksDataException {
         int offset = getOpenFieldValueOffset(recordType, fieldId);
         ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(getOpenFieldTag(recordType, fieldId));
         return NonTaggedFormatUtil.getFieldValueLength(bytes, offset, tag, true);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/NonTaggedFormatUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/NonTaggedFormatUtil.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/NonTaggedFormatUtil.java
index 37e8c05..8558538 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/NonTaggedFormatUtil.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/utils/NonTaggedFormatUtil.java
@@ -19,7 +19,7 @@
 package org.apache.asterix.om.utils;
 
 import org.apache.asterix.common.config.DatasetConfig.IndexType;
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AIntervalSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
@@ -39,6 +39,7 @@ import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
 import org.apache.hyracks.api.dataflow.value.ITypeTraits;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.data.std.primitive.ByteArrayPointable;
 import org.apache.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizerFactory;
 import org.apache.hyracks.util.string.UTF8StringUtil;
@@ -106,12 +107,12 @@ public final class NonTaggedFormatUtil {
     }
 
     public static int getFieldValueLength(byte[] serNonTaggedAObject, int offset, ATypeTag typeTag, boolean tagged)
-            throws AsterixException {
+            throws HyracksDataException {
         switch (typeTag) {
             case ANY:
                 ATypeTag tag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serNonTaggedAObject[offset]);
                 if (tag == ATypeTag.ANY) {
-                    throw new AsterixException("Field value has type tag ANY, but it should have a concrete type.");
+                    throw HyracksDataException.create(ErrorCode.FIELD_SHOULD_BE_TYPED);
                 }
                 return getFieldValueLength(serNonTaggedAObject, offset, tag, true) + 1;
             case MISSING:

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AbstractAsterixListIterator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AbstractAsterixListIterator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AbstractAsterixListIterator.java
index 379c362..c07aae2 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AbstractAsterixListIterator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/AbstractAsterixListIterator.java
@@ -18,7 +18,6 @@
  */
 package org.apache.asterix.runtime.evaluators.common;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.formats.nontagged.BinaryComparatorFactoryProvider;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.EnumDeserializer;
@@ -72,32 +71,24 @@ public abstract class AbstractAsterixListIterator implements ISequenceIterator {
 
     @Override
     public void next() throws HyracksDataException {
-        try {
-            pos = nextPos;
-            ++count;
-            nextPos = startOff + listLength;
-            if (count + 1 < numberOfItems) {
-                nextPos = getItemOffset(data, startOff, count + 1);
-            }
-            itemLen = nextPos - pos;
-        } catch (AsterixException e) {
-            throw new HyracksDataException(e);
+        pos = nextPos;
+        ++count;
+        nextPos = startOff + listLength;
+        if (count + 1 < numberOfItems) {
+            nextPos = getItemOffset(data, startOff, count + 1);
         }
+        itemLen = nextPos - pos;
     }
 
     @Override
     public void reset() throws HyracksDataException {
         count = 0;
-        try {
-            pos = getItemOffset(data, startOff, count);
-            nextPos = startOff + listLength;
-            if (count + 1 < numberOfItems) {
-                nextPos = getItemOffset(data, startOff, count + 1);
-            }
-            itemLen = nextPos - pos;
-        } catch (AsterixException e) {
-            throw new HyracksDataException(e);
+        pos = getItemOffset(data, startOff, count);
+        nextPos = startOff + listLength;
+        if (count + 1 < numberOfItems) {
+            nextPos = getItemOffset(data, startOff, count + 1);
         }
+        itemLen = nextPos - pos;
     }
 
     @Override
@@ -153,7 +144,7 @@ public abstract class AbstractAsterixListIterator implements ISequenceIterator {
         reset();
     }
 
-    protected abstract int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException;
+    protected abstract int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws HyracksDataException;
 
     protected abstract int getNumberOfItems(byte[] serOrderedList, int offset);
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/ListAccessor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/ListAccessor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/ListAccessor.java
index c03cfa6..3c97fc9 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/ListAccessor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/ListAccessor.java
@@ -22,7 +22,6 @@ package org.apache.asterix.runtime.evaluators.common;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
 import org.apache.asterix.om.types.ATypeTag;
@@ -76,7 +75,7 @@ public class ListAccessor {
         return size;
     }
 
-    public int getItemOffset(int itemIndex) throws AsterixException {
+    public int getItemOffset(int itemIndex) throws HyracksDataException {
         if (listType == ATypeTag.MULTISET) {
             return AUnorderedListSerializerDeserializer.getItemOffset(listBytes, start, itemIndex);
         } else {
@@ -84,12 +83,12 @@ public class ListAccessor {
         }
     }
 
-    public int getItemLength(int itemOffset) throws AsterixException {
+    public int getItemLength(int itemOffset) throws HyracksDataException {
         ATypeTag itemType = getItemType(itemOffset);
         return NonTaggedFormatUtil.getFieldValueLength(listBytes, itemOffset, itemType, itemsAreSelfDescribing());
     }
 
-    public ATypeTag getItemType(int itemOffset) throws AsterixException {
+    public ATypeTag getItemType(int itemOffset) {
         if (itemType == ATypeTag.ANY) {
             return EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(listBytes[itemOffset]);
         } else {
@@ -97,7 +96,7 @@ public class ListAccessor {
         }
     }
 
-    public void writeItem(int itemIndex, DataOutput dos) throws AsterixException, IOException {
+    public void writeItem(int itemIndex, DataOutput dos) throws IOException {
         int itemOffset = getItemOffset(itemIndex);
         int itemLength = getItemLength(itemOffset);
         if (itemsAreSelfDescribing()) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/OrderedListIterator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/OrderedListIterator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/OrderedListIterator.java
index f0c2f5a..c5add44 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/OrderedListIterator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/OrderedListIterator.java
@@ -18,13 +18,13 @@
  */
 package org.apache.asterix.runtime.evaluators.common;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public final class OrderedListIterator extends AbstractAsterixListIterator {
 
     @Override
-    protected int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException {
+    protected int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws HyracksDataException {
         return AOrderedListSerializerDeserializer.getItemOffset(serOrderedList, offset, itemIndex);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
index f519065..b70c6ad 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/SimilarityJaccardPrefixEvaluator.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.common;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
@@ -72,8 +71,8 @@ public class SimilarityJaccardPrefixEvaluator implements IScalarEvaluator {
     // result
     protected final AMutableFloat res = new AMutableFloat(0);
     @SuppressWarnings("unchecked")
-    protected final ISerializerDeserializer<AFloat> reusSerde = SerializerDeserializerProvider.INSTANCE
-            .getSerializerDeserializer(BuiltinType.AFLOAT);
+    protected final ISerializerDeserializer<AFloat> reusSerde =
+            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AFLOAT);
 
     public SimilarityJaccardPrefixEvaluator(IScalarEvaluatorFactory[] args, IHyracksTaskContext context)
             throws HyracksDataException {
@@ -91,8 +90,8 @@ public class SimilarityJaccardPrefixEvaluator implements IScalarEvaluator {
         // similarity threshold
         sim = 0;
         evalThreshold.evaluate(tuple, inputVal);
-        float similarityThreshold = AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(),
-                inputVal.getStartOffset() + 1);
+        float similarityThreshold =
+                AFloatSerializerDeserializer.getFloat(inputVal.getByteArray(), inputVal.getStartOffset() + 1);
 
         if (similarityThreshold != similarityThresholdCache || similarityFilters == null) {
             similarityFilters = new SimilarityFiltersJaccard(similarityThreshold);
@@ -126,39 +125,23 @@ public class SimilarityJaccardPrefixEvaluator implements IScalarEvaluator {
 
             int lengthTokens1;
             if (serList[startOffset] == ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG) {
-                lengthTokens1 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(),
-                        startOffset);
+                lengthTokens1 =
+                        AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(), startOffset);
                 // read tokens
                 for (i = 0; i < lengthTokens1; i++) {
-                    int itemOffset;
-                    int token;
-                    try {
-                        itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
-                    }
-                    token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 1, serList, itemOffset,
-                                startOffset + 1);
+                    int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
+                    int token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 1, serList, itemOffset, startOffset + 1);
                     tokens1.add(token);
                 }
             } else {
-                lengthTokens1 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(),
-                        startOffset);
+                lengthTokens1 =
+                        AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(), startOffset);
                 // read tokens
                 for (i = 0; i < lengthTokens1; i++) {
-                    int itemOffset;
-                    int token;
-
-                    try {
-                        itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
-                    }
-
-                    token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 1, serList, itemOffset,
-                                startOffset + 1);
+                    int itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
+                    int token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 1, serList, itemOffset, startOffset + 1);
                     tokens1.add(token);
                 }
             }
@@ -181,39 +164,23 @@ public class SimilarityJaccardPrefixEvaluator implements IScalarEvaluator {
 
             int lengthTokens2;
             if (serList[startOffset] == ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG) {
-                lengthTokens2 = AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(),
-                        startOffset);
+                lengthTokens2 =
+                        AOrderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(), startOffset);
                 // read tokens
                 for (i = 0; i < lengthTokens2; i++) {
-                    int itemOffset;
-                    int token;
-
-                    try {
-                        itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
-                    }
-                    token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 3, serList, itemOffset,
-                                startOffset + 1);
+                    int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
+                    int token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 3, serList, itemOffset, startOffset + 1);
                     tokens2.add(token);
                 }
             } else {
-                lengthTokens2 = AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(),
-                        startOffset);
+                lengthTokens2 =
+                        AUnorderedListSerializerDeserializer.getNumberOfItems(inputVal.getByteArray(), startOffset);
                 // read tokens
                 for (i = 0; i < lengthTokens2; i++) {
-                    int itemOffset;
-                    int token;
-
-                    try {
-                        itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
-                    }
-                    token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 3, serList, itemOffset,
-                                startOffset + 1);
+                    int itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, startOffset, i);
+                    int token = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                            BuiltinFunctions.SIMILARITY_JACCARD.getName(), 3, serList, itemOffset, startOffset + 1);
                     tokens2.add(token);
                 }
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/UnorderedListIterator.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/UnorderedListIterator.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/UnorderedListIterator.java
index ee58011..b755da2 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/UnorderedListIterator.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/common/UnorderedListIterator.java
@@ -18,13 +18,13 @@
  */
 package org.apache.asterix.runtime.evaluators.common;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
+import org.apache.hyracks.api.exceptions.HyracksDataException;
 
 public final class UnorderedListIterator extends AbstractAsterixListIterator {
 
     @Override
-    protected int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws AsterixException {
+    protected int getItemOffset(byte[] serOrderedList, int offset, int itemIndex) throws HyracksDataException {
         return AUnorderedListSerializerDeserializer.getItemOffset(serOrderedList, offset, itemIndex);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
index 714fabe..b78bc5c 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/AnyCollectionMemberDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AUnorderedListSerializerDeserializer;
 import org.apache.asterix.om.functions.BuiltinFunctions;
@@ -96,9 +95,8 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
 
                     if (serList[offset] != ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG
                             && serList[offset] != ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG) {
-                        throw new TypeMismatchException(BuiltinFunctions.ANY_COLLECTION_MEMBER, 0,
-                                serList[offset], ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG,
-                                ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG);
+                        throw new TypeMismatchException(BuiltinFunctions.ANY_COLLECTION_MEMBER, 0, serList[offset],
+                                ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG, ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG);
                     }
 
                     try {
@@ -127,8 +125,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;
                             result.set(serList, itemOffset, itemLength);
                         } else {
                             itemLength = NonTaggedFormatUtil.getFieldValueLength(serList, itemOffset, itemTag, false);
@@ -137,9 +135,7 @@ public class AnyCollectionMemberDescriptor extends AbstractScalarFunctionDynamic
                             result.set(resultStorage);
                         }
                     } catch (IOException e) {
-                        throw new HyracksDataException(e);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
+                        throw HyracksDataException.create(e);
                     }
                 }
             };

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
index 09e15b5..a59d03d 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -99,39 +98,32 @@ public class CodePointToStringDescriptor extends AbstractScalarFunctionDynamicDe
                                         throw new UnsupportedTypeException(getIdentifier(), serOrderedList[offset]);
                                 }
                             }
-
-                            try {
-                                // calculate length first
-                                int utf_8_len = 0;
-                                for (int i = 0; i < size; i++) {
-                                    int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serOrderedList,
-                                            offset, i);
-                                    int codePoint = 0;
-                                    codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                                            getIdentifier().getName(), 0,
-                                            serOrderedList, itemOffset, offset + 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,
-                                            offset, i);
-                                    int codePoint = 0;
-                                    codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
-                                            getIdentifier().getName(), 0,
-                                            serOrderedList, itemOffset, offset + 1);
-                                    utf_8_len = UTF8StringUtil.codePointToUTF8(codePoint, currentUTF8);
-                                    for (int j = 0; j < utf_8_len; j++) {
-                                        out.writeByte(currentUTF8[j]);
-                                    }
+                            // calculate length first
+                            int utf_8_len = 0;
+                            for (int i = 0; i < size; i++) {
+                                int itemOffset =
+                                        AOrderedListSerializerDeserializer.getItemOffset(serOrderedList, offset, i);
+                                int codePoint = 0;
+                                codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                                        getIdentifier().getName(), 0, serOrderedList, itemOffset, offset + 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, offset, i);
+                                int codePoint = 0;
+                                codePoint = ATypeHierarchy.getIntegerValueWithDifferentTypeTagPosition(
+                                        getIdentifier().getName(), 0, serOrderedList, itemOffset, offset + 1);
+                                utf_8_len = UTF8StringUtil.codePointToUTF8(codePoint, currentUTF8);
+                                for (int j = 0; j < utf_8_len; j++) {
+                                    out.writeByte(currentUTF8[j]);
                                 }
-                                result.set(resultStorage);
-                            } catch (AsterixException ex) {
-                                throw new HyracksDataException(ex);
                             }
-                        } catch (IOException e1) {
-                            throw new HyracksDataException(e1);
+                            result.set(resultStorage);
+                        } catch (IOException e) {
+                            throw HyracksDataException.create(e);
                         }
                     }
                 };

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
index 76d9cf3..74f8757 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CreatePolygonDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.APointSerializerDeserializer;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
@@ -75,10 +74,10 @@ public class CreatePolygonDescriptor extends AbstractScalarFunctionDynamicDescri
                     private final IPointable inputArgList = new VoidPointable();
                     private final IScalarEvaluator evalList = listEvalFactory.createScalarEvaluator(ctx);
                     @SuppressWarnings("unchecked")
-                    private final ISerializerDeserializer<ANull> nullSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.ANULL);
-                    private final ISerializerDeserializer<AMissing> missingSerde = SerializerDeserializerProvider.
-                            INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
+                    private final ISerializerDeserializer<ANull> nullSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+                    private final ISerializerDeserializer<AMissing> missingSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
@@ -95,51 +94,46 @@ public class CreatePolygonDescriptor extends AbstractScalarFunctionDynamicDescri
                                         ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG);
                             }
                             listAccessor.reset(listBytes, offset);
-                            try {
-                                // First check the list consists of a valid items
-                                for (int i = 0; i < listAccessor.size(); i++) {
-                                    int itemOffset = listAccessor.getItemOffset(i);
-                                    ATypeTag itemType = listAccessor.getItemType(itemOffset);
-                                    if (itemType != ATypeTag.DOUBLE) {
-                                        if (itemType == ATypeTag.NULL) {
-                                            nullSerde.serialize(ANull.NULL, out);
-                                            return;
-                                        }
-                                        if (itemType == ATypeTag.MISSING) {
-                                            missingSerde.serialize(AMissing.MISSING, out);
-                                            return;
-                                        }
-                                        throw new UnsupportedItemTypeException(BuiltinFunctions.CREATE_POLYGON,
-                                                itemType.serialize());
+                            // First check the list consists of a valid items
+                            for (int i = 0; i < listAccessor.size(); i++) {
+                                int itemOffset = listAccessor.getItemOffset(i);
+                                ATypeTag itemType = listAccessor.getItemType(itemOffset);
+                                if (itemType != ATypeTag.DOUBLE) {
+                                    if (itemType == ATypeTag.NULL) {
+                                        nullSerde.serialize(ANull.NULL, out);
+                                        return;
                                     }
-
-                                }
-                                if (listAccessor.size() < 6) {
-                                    throw new InvalidDataFormatException(getIdentifier(),
-                                            ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
-                                } else if (listAccessor.size() % 2 != 0) {
-                                    throw new InvalidDataFormatException(getIdentifier(),
-                                            ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
+                                    if (itemType == ATypeTag.MISSING) {
+                                        missingSerde.serialize(AMissing.MISSING, out);
+                                        return;
+                                    }
+                                    throw new UnsupportedItemTypeException(BuiltinFunctions.CREATE_POLYGON,
+                                            itemType.serialize());
                                 }
-                                out.writeByte(ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
-                                out.writeShort(listAccessor.size() / 2);
 
-                                final int skipTypeTag = listAccessor.itemsAreSelfDescribing() ? 1 : 0;
-                                for (int i = 0; i < listAccessor.size() / 2; i++) {
-                                    int firstDoubleOffset = listAccessor.getItemOffset(i * 2) + skipTypeTag;
-                                    int secondDobuleOffset = listAccessor.getItemOffset((i * 2) + 1) + skipTypeTag;
+                            }
+                            if (listAccessor.size() < 6) {
+                                throw new InvalidDataFormatException(getIdentifier(),
+                                        ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
+                            } else if (listAccessor.size() % 2 != 0) {
+                                throw new InvalidDataFormatException(getIdentifier(),
+                                        ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
+                            }
+                            out.writeByte(ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
+                            out.writeShort(listAccessor.size() / 2);
 
-                                    APointSerializerDeserializer.serialize(
-                                            ADoubleSerializerDeserializer.getDouble(listBytes, firstDoubleOffset),
-                                            ADoubleSerializerDeserializer.getDouble(listBytes, secondDobuleOffset),
-                                            out);
-                                }
-                                result.set(resultStorage);
-                            } catch (AsterixException ex) {
-                                throw new HyracksDataException(ex);
+                            final int skipTypeTag = listAccessor.itemsAreSelfDescribing() ? 1 : 0;
+                            for (int i = 0; i < listAccessor.size() / 2; i++) {
+                                int firstDoubleOffset = listAccessor.getItemOffset(i * 2) + skipTypeTag;
+                                int secondDobuleOffset = listAccessor.getItemOffset((i * 2) + 1) + skipTypeTag;
+
+                                APointSerializerDeserializer.serialize(
+                                        ADoubleSerializerDeserializer.getDouble(listBytes, firstDoubleOffset),
+                                        ADoubleSerializerDeserializer.getDouble(listBytes, secondDobuleOffset), out);
                             }
-                        } catch (IOException e1) {
-                            throw new HyracksDataException(e1);
+                            result.set(resultStorage);
+                        } catch (IOException e) {
+                            throw HyracksDataException.create(e);
                         }
                     }
                 };

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/GetItemDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/GetItemDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/GetItemDescriptor.java
index 276c9ae..0c55ef1 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/GetItemDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/GetItemDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.functions.IFunctionDescriptor;
@@ -106,8 +105,8 @@ public class GetItemDescriptor extends AbstractScalarFunctionDynamicDescriptor {
                             itemIndex = ATypeHierarchy.getIntegerValue(BuiltinFunctions.GET_ITEM.getName(), 0,
                                     indexBytes, indexOffset);
                         } else {
-                            throw new TypeMismatchException(BuiltinFunctions.GET_ITEM,
-                                    0, serOrderedList[offset], ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG);
+                            throw new TypeMismatchException(BuiltinFunctions.GET_ITEM, 0, serOrderedList[offset],
+                                    ATypeTag.SERIALIZED_ORDEREDLIST_TYPE_TAG);
                         }
 
                         if (itemIndex < 0 || itemIndex >= AOrderedListSerializerDeserializer
@@ -124,26 +123,25 @@ public class GetItemDescriptor extends AbstractScalarFunctionDynamicDescriptor {
                             serItemTypeTag = serOrderedList[offset + 1];
                         }
 
-                        itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serOrderedList, offset,
-                                itemIndex);
+                        itemOffset =
+                                AOrderedListSerializerDeserializer.getItemOffset(serOrderedList, offset, itemIndex);
 
                         if (selfDescList) {
                             itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serOrderedList[itemOffset]);
-                            itemLength = NonTaggedFormatUtil.getFieldValueLength(serOrderedList, itemOffset, itemTag,
-                                    true) + 1;
+                            itemLength =
+                                    NonTaggedFormatUtil.getFieldValueLength(serOrderedList, itemOffset, itemTag, true)
+                                            + 1;
                             result.set(serOrderedList, itemOffset, itemLength);
                         } else {
-                            itemLength = NonTaggedFormatUtil.getFieldValueLength(serOrderedList, itemOffset, itemTag,
-                                    false);
+                            itemLength =
+                                    NonTaggedFormatUtil.getFieldValueLength(serOrderedList, itemOffset, itemTag, false);
                             resultStorage.reset();
                             output.writeByte(serItemTypeTag);
                             output.write(serOrderedList, itemOffset, itemLength);
                             result.set(resultStorage);
                         }
                     } catch (IOException e) {
-                        throw new HyracksDataException(e);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
+                        throw HyracksDataException.create(e);
                     }
                 }
             };

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SimilarityDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
index 385b2c1..8584d06 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SimilarityDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.functions.FunctionConstants;
 import org.apache.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
@@ -33,13 +32,13 @@ import org.apache.asterix.fuzzyjoin.similarity.SimilarityFilters;
 import org.apache.asterix.fuzzyjoin.similarity.SimilarityMetric;
 import org.apache.asterix.om.base.ADouble;
 import org.apache.asterix.om.base.AMutableDouble;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.om.functions.IFunctionDescriptor;
 import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
 import org.apache.asterix.runtime.evaluators.common.SimilarityFiltersCache;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
@@ -55,8 +54,8 @@ import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
 public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescriptor {
 
     private static final long serialVersionUID = 1L;
-    private final static FunctionIdentifier FID = new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "similarity@7",
-            7);
+    private final static FunctionIdentifier FID =
+            new FunctionIdentifier(FunctionConstants.ASTERIX_NS, "similarity@7", 7);
     public static final IFunctionDescriptorFactory FACTORY = new IFunctionDescriptorFactory() {
         @Override
         public IFunctionDescriptor createFunctionDescriptor() {
@@ -94,8 +93,8 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
                     // result
                     private final AMutableDouble res = new AMutableDouble(0);
                     @SuppressWarnings("unchecked")
-                    private final ISerializerDeserializer<ADouble> doubleSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.ADOUBLE);
+                    private final ISerializerDeserializer<ADouble> doubleSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ADOUBLE);
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
@@ -120,8 +119,8 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
                             throw new TypeMismatchException(getIdentifier(), 1, data[offset],
                                     ATypeTag.SERIALIZED_DOUBLE_TYPE_TAG);
                         }
-                        SimilarityFilters similarityFilters = similarityFiltersCache.get(similarityThreshold, data,
-                                offset, len);
+                        SimilarityFilters similarityFilters =
+                                similarityFiltersCache.get(similarityThreshold, data, offset, len);
 
                         evalLen1.evaluate(tuple, inputVal);
                         data = inputVal.getByteArray();
@@ -167,26 +166,16 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
                                 lengthTokens1 = AOrderedListSerializerDeserializer.getNumberOfItems(serList, offset);
                                 // read tokens
                                 for (i = 0; i < lengthTokens1; i++) {
-                                    int itemOffset;
-                                    try {
-                                        itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, offset,
-                                                i);
-                                    } catch (AsterixException e) {
-                                        throw new HyracksDataException(e);
-                                    }
+                                    int itemOffset =
+                                            AOrderedListSerializerDeserializer.getItemOffset(serList, offset, i);
                                     tokens1.add(IntegerPointable.getInteger(serList, itemOffset));
                                 }
                             } else {
                                 lengthTokens1 = AUnorderedListSerializerDeserializer.getNumberOfItems(serList, offset);
                                 // read tokens
                                 for (i = 0; i < lengthTokens1; i++) {
-                                    int itemOffset;
-                                    try {
-                                        itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, offset,
-                                                i);
-                                    } catch (AsterixException e) {
-                                        throw new HyracksDataException(e);
-                                    }
+                                    int itemOffset =
+                                            AUnorderedListSerializerDeserializer.getItemOffset(serList, offset, i);
                                     tokens1.add(IntegerPointable.getInteger(serList, itemOffset));
                                 }
                             }
@@ -213,26 +202,16 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
                                 lengthTokens2 = AOrderedListSerializerDeserializer.getNumberOfItems(serList, offset);
                                 // read tokens
                                 for (i = 0; i < lengthTokens2; i++) {
-                                    int itemOffset;
-                                    try {
-                                        itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList, offset,
-                                                i);
-                                    } catch (AsterixException e) {
-                                        throw new HyracksDataException(e);
-                                    }
+                                    int itemOffset =
+                                            AOrderedListSerializerDeserializer.getItemOffset(serList, offset, i);
                                     tokens2.add(IntegerPointable.getInteger(serList, itemOffset));
                                 }
                             } else {
                                 lengthTokens2 = AUnorderedListSerializerDeserializer.getNumberOfItems(serList, offset);
                                 // read tokens
                                 for (i = 0; i < lengthTokens2; i++) {
-                                    int itemOffset;
-                                    try {
-                                        itemOffset = AUnorderedListSerializerDeserializer.getItemOffset(serList, offset,
-                                                i);
-                                    } catch (AsterixException e) {
-                                        throw new HyracksDataException(e);
-                                    }
+                                    int itemOffset =
+                                            AUnorderedListSerializerDeserializer.getItemOffset(serList, offset, i);
                                     tokens2.add(IntegerPointable.getInteger(serList, itemOffset));
                                 }
                             }
@@ -243,8 +222,8 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
 
                             // -- - token prefix - --
                             evalTokenPrefix.evaluate(tuple, inputVal);
-                            int tokenPrefix = IntegerPointable.getInteger(inputVal.getByteArray(),
-                                    inputVal.getStartOffset() + 1);
+                            int tokenPrefix =
+                                    IntegerPointable.getInteger(inputVal.getByteArray(), inputVal.getStartOffset() + 1);
 
                             //
                             // -- - position filter - --
@@ -272,7 +251,7 @@ public class SimilarityDescriptor extends AbstractScalarFunctionDynamicDescripto
                         try {
                             doubleSerde.serialize(res, out);
                         } catch (IOException e) {
-                            throw new HyracksDataException(e);
+                            throw HyracksDataException.create(e);
                         }
                         result.set(resultStorage);
                     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringConcatDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
index 8ad3255..851e1a4 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringConcatDescriptor.java
@@ -21,11 +21,9 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AMissing;
 import org.apache.asterix.om.base.ANull;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.functions.IFunctionDescriptor;
 import org.apache.asterix.om.functions.IFunctionDescriptorFactory;
@@ -33,6 +31,7 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
 import org.apache.asterix.runtime.evaluators.common.ListAccessor;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.runtime.exceptions.UnsupportedItemTypeException;
 import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -72,10 +71,10 @@ public class StringConcatDescriptor extends AbstractScalarFunctionDynamicDescrip
                     private final IPointable inputArgList = new VoidPointable();
                     private final IScalarEvaluator evalList = listEvalFactory.createScalarEvaluator(ctx);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.ANULL);
-                    private ISerializerDeserializer<AMissing> missingSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.AMISSING);
+                    private ISerializerDeserializer<ANull> nullSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+                    private ISerializerDeserializer<AMissing> missingSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
                     private final byte[] tempLengthArray = new byte[5];
 
                     @Override
@@ -93,49 +92,45 @@ public class StringConcatDescriptor extends AbstractScalarFunctionDynamicDescrip
                                         ATypeTag.SERIALIZED_UNORDEREDLIST_TYPE_TAG);
                             }
                             listAccessor.reset(listBytes, listOffset);
-                            try {
-                                // calculate length first
-                                int utf8Len = 0;
-                                for (int i = 0; i < listAccessor.size(); i++) {
-                                    int itemOffset = listAccessor.getItemOffset(i);
-                                    ATypeTag itemType = listAccessor.getItemType(itemOffset);
-                                    // Increase the offset by 1 if the give list has heterogeneous elements,
-                                    // since the item itself has a typetag.
-                                    if (listAccessor.itemsAreSelfDescribing()) {
-                                        itemOffset += 1;
+                            // calculate length first
+                            int utf8Len = 0;
+                            for (int i = 0; i < listAccessor.size(); i++) {
+                                int itemOffset = listAccessor.getItemOffset(i);
+                                ATypeTag itemType = listAccessor.getItemType(itemOffset);
+                                // Increase the offset by 1 if the give list has heterogeneous elements,
+                                // since the item itself has a typetag.
+                                if (listAccessor.itemsAreSelfDescribing()) {
+                                    itemOffset += 1;
+                                }
+                                if (itemType != ATypeTag.STRING) {
+                                    if (itemType == ATypeTag.NULL) {
+                                        nullSerde.serialize(ANull.NULL, out);
+                                        result.set(resultStorage);
+                                        return;
                                     }
-                                    if (itemType != ATypeTag.STRING) {
-                                        if (itemType == ATypeTag.NULL) {
-                                            nullSerde.serialize(ANull.NULL, out);
-                                            result.set(resultStorage);
-                                            return;
-                                        }
-                                        if (itemType == ATypeTag.MISSING) {
-                                            missingSerde.serialize(AMissing.MISSING, out);
-                                            result.set(resultStorage);
-                                            return;
-                                        }
-                                        throw new UnsupportedItemTypeException(getIdentifier(), itemType.serialize());
+                                    if (itemType == ATypeTag.MISSING) {
+                                        missingSerde.serialize(AMissing.MISSING, out);
+                                        result.set(resultStorage);
+                                        return;
                                     }
-                                    utf8Len += UTF8StringUtil.getUTFLength(listBytes, itemOffset);
+                                    throw new UnsupportedItemTypeException(getIdentifier(), itemType.serialize());
                                 }
-                                out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
-                                int cbytes = UTF8StringUtil.encodeUTF8Length(utf8Len, tempLengthArray, 0);
-                                out.write(tempLengthArray, 0, cbytes);
-                                for (int i = 0; i < listAccessor.size(); i++) {
-                                    int itemOffset = listAccessor.getItemOffset(i);
-                                    if (listAccessor.itemsAreSelfDescribing()) {
-                                        itemOffset += 1;
-                                    }
-                                    utf8Len = UTF8StringUtil.getUTFLength(listBytes, itemOffset);
-                                    out.write(listBytes, UTF8StringUtil.getNumBytesToStoreLength(utf8Len) + itemOffset,
-                                            utf8Len);
+                                utf8Len += UTF8StringUtil.getUTFLength(listBytes, itemOffset);
+                            }
+                            out.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG);
+                            int cbytes = UTF8StringUtil.encodeUTF8Length(utf8Len, tempLengthArray, 0);
+                            out.write(tempLengthArray, 0, cbytes);
+                            for (int i = 0; i < listAccessor.size(); i++) {
+                                int itemOffset = listAccessor.getItemOffset(i);
+                                if (listAccessor.itemsAreSelfDescribing()) {
+                                    itemOffset += 1;
                                 }
-                            } catch (AsterixException ex) {
-                                throw new HyracksDataException(ex);
+                                utf8Len = UTF8StringUtil.getUTFLength(listBytes, itemOffset);
+                                out.write(listBytes, UTF8StringUtil.getNumBytesToStoreLength(utf8Len) + itemOffset,
+                                        utf8Len);
                             }
-                        } catch (IOException e1) {
-                            throw new HyracksDataException(e1);
+                        } catch (IOException e) {
+                            throw HyracksDataException.create(e);
                         }
                         result.set(resultStorage);
                     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringJoinDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
index 6cfdffc..70b3687 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/StringJoinDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AMissing;
 import org.apache.asterix.om.base.ANull;
@@ -74,10 +73,10 @@ public class StringJoinDescriptor extends AbstractScalarFunctionDynamicDescripto
                     private final IScalarEvaluator evalList = listEvalFactory.createScalarEvaluator(ctx);
                     private final IScalarEvaluator evalSep = sepEvalFactory.createScalarEvaluator(ctx);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.ANULL);
-                    private ISerializerDeserializer<AMissing> missingSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.AMISSING);
+                    private ISerializerDeserializer<ANull> nullSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
+                    private ISerializerDeserializer<AMissing> missingSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
                     private final byte[] tempLengthArray = new byte[5];
 
                     @Override
@@ -151,8 +150,8 @@ public class StringJoinDescriptor extends AbstractScalarFunctionDynamicDescripto
                                     out.writeByte(sepBytes[sepOffset + 1 + sepMetaLen + j]);
                                 }
                             }
-                        } catch (IOException | AsterixException ex) {
-                            throw new HyracksDataException(ex);
+                        } catch (IOException ex) {
+                            throw HyracksDataException.create(ex);
                         }
                         result.set(resultStorage);
                     }


Mime
View raw message