asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [1/2] asterixdb git commit: Clean up exceptions in runtime functions.
Date Fri, 09 Jun 2017 05:33:20 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 0832322e8 -> 81799ab0f


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/BinaryConcatDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/BinaryConcatDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/BinaryConcatDescriptor.java
index b394062..907dfd3 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/BinaryConcatDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/binary/BinaryConcatDescriptor.java
@@ -21,7 +21,6 @@ package org.apache.asterix.runtime.evaluators.functions.binary;
 
 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;
@@ -72,11 +71,11 @@ public class BinaryConcatDescriptor extends AbstractScalarFunctionDynamicDescrip
                     private final ListAccessor listAccessor = new ListAccessor();
                     private final byte[] metaBuffer = new byte[5];
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<ANull> nullSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.ANULL);
+                    private ISerializerDeserializer<ANull> nullSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
                     @SuppressWarnings("unchecked")
-                    private ISerializerDeserializer<AMissing> missingSerde = SerializerDeserializerProvider.INSTANCE
-                            .getSerializerDeserializer(BuiltinType.AMISSING);
+                    private ISerializerDeserializer<AMissing> missingSerde =
+                            SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
 
                     @Override
                     public void evaluate(IFrameTupleReference tuple, IPointable result) throws
HyracksDataException {
@@ -118,9 +117,7 @@ public class BinaryConcatDescriptor extends AbstractScalarFunctionDynamicDescrip
                                         itemOffset + ByteArrayPointable.getNumberBytesToStoreMeta(length),
length);
                             }
                         } catch (IOException e) {
-                            throw new HyracksDataException(e);
-                        } catch (AsterixException 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/records/FieldAccessByIndexEvalFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
index 3321efc..d5918cb 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByIndexEvalFactory.java
@@ -21,9 +21,7 @@ package org.apache.asterix.runtime.evaluators.functions.records;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
@@ -31,6 +29,7 @@ import org.apache.asterix.om.types.AUnionType;
 import org.apache.asterix.om.types.IAType;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
 import org.apache.asterix.om.utils.RecordUtil;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
@@ -90,15 +89,15 @@ public class FieldAccessByIndexEvalFactory implements IScalarEvaluatorFactory
{
                     int offset = inputArg0.getStartOffset();
 
                     if (serRecord[offset] != ATypeTag.SERIALIZED_RECORD_TYPE_TAG) {
-                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_BY_INDEX,
0,
-                                serRecord[offset], ATypeTag.SERIALIZED_RECORD_TYPE_TAG);
+                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_BY_INDEX,
0, serRecord[offset],
+                                ATypeTag.SERIALIZED_RECORD_TYPE_TAG);
                     }
                     eval1.evaluate(tuple, inputArg1);
                     byte[] indexBytes = inputArg1.getByteArray();
                     int indexOffset = inputArg1.getStartOffset();
                     if (indexBytes[indexOffset] != ATypeTag.SERIALIZED_INT32_TYPE_TAG) {
-                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_BY_INDEX,
1,
-                                indexBytes[offset], ATypeTag.SERIALIZED_INT32_TYPE_TAG);
+                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_BY_INDEX,
1, indexBytes[offset],
+                                ATypeTag.SERIALIZED_INT32_TYPE_TAG);
                     }
                     fieldIndex = IntegerPointable.getInteger(indexBytes, indexOffset + 1);
                     fieldValueType = recordType.getFieldTypes()[fieldIndex];
@@ -137,9 +136,7 @@ public class FieldAccessByIndexEvalFactory implements IScalarEvaluatorFactory
{
                     out.write(serRecord, fieldValueOffset, fieldValueLength);
                     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/records/FieldAccessByNameEvalFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
index 87fa292..2078921 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessByNameEvalFactory.java
@@ -21,13 +21,12 @@ package org.apache.asterix.runtime.evaluators.functions.records;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
@@ -94,9 +93,7 @@ public class FieldAccessByNameEvalFactory implements IScalarEvaluatorFactory
{
                             fieldValueTypeTag, true) + 1;
                     result.set(serRecord, fieldValueOffset, fieldValueLength);
                 } 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/records/FieldAccessNestedEvalFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
index 2da8e90..067a458 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/FieldAccessNestedEvalFactory.java
@@ -22,7 +22,6 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.om.base.AMissing;
@@ -80,11 +79,11 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
             private final IPointable[] fieldPointables = new VoidPointable[fieldPath.size()];
             private final RuntimeRecordTypeInfo[] recTypeInfos = new RuntimeRecordTypeInfo[fieldPath.size()];
             @SuppressWarnings("unchecked")
-            private final ISerializerDeserializer<ANull> nullSerde = SerializerDeserializerProvider.INSTANCE
-                    .getSerializerDeserializer(BuiltinType.ANULL);
+            private final ISerializerDeserializer<ANull> nullSerde =
+                    SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.ANULL);
             @SuppressWarnings("unchecked")
-            private final ISerializerDeserializer<AMissing> missingSerde = SerializerDeserializerProvider.INSTANCE
-                    .getSerializerDeserializer(BuiltinType.AMISSING);
+            private final ISerializerDeserializer<AMissing> missingSerde =
+                    SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.AMISSING);
 
             {
                 generateFieldsPointables();
@@ -100,8 +99,7 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                     ArrayBackedValueStorage storage = new ArrayBackedValueStorage();
                     DataOutput out = storage.getDataOutput();
                     AString as = new AString(fieldPath.get(i));
-                    SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(as.getType()).serialize(as,
-                                out);
+                    SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(as.getType()).serialize(as,
out);
                     fieldPointables[i] = new VoidPointable();
                     fieldPointables[i].set(storage);
                 }
@@ -118,8 +116,8 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                     int len = inputArg0.getLength();
 
                     if (serRecord[start] != ATypeTag.SERIALIZED_RECORD_TYPE_TAG) {
-                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_NESTED,
0,
-                                serRecord[start], ATypeTag.SERIALIZED_RECORD_TYPE_TAG);
+                        throw new TypeMismatchException(BuiltinFunctions.FIELD_ACCESS_NESTED,
0, serRecord[start],
+                                ATypeTag.SERIALIZED_RECORD_TYPE_TAG);
                     }
 
                     int subFieldIndex = -1;
@@ -141,8 +139,7 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                             subType = ((AUnionType) subType).getActualType();
                             byte serializedTypeTag = subType.getTypeTag().serialize();
                             if (serializedTypeTag != ATypeTag.SERIALIZED_RECORD_TYPE_TAG)
{
-                                throw new UnsupportedTypeException(
-                                        BuiltinFunctions.FIELD_ACCESS_NESTED.getName(),
+                                throw new UnsupportedTypeException(BuiltinFunctions.FIELD_ACCESS_NESTED.getName(),
                                         serializedTypeTag);
                             }
                             if (subType.getTypeTag() == ATypeTag.OBJECT) {
@@ -198,8 +195,7 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                         // type check
                         if (pathIndex < fieldPointables.length - 1
                                 && serRecord[start] != ATypeTag.SERIALIZED_RECORD_TYPE_TAG)
{
-                            throw new UnsupportedTypeException(BuiltinFunctions.FIELD_ACCESS_NESTED,
-                                    serRecord[start]);
+                            throw new UnsupportedTypeException(BuiltinFunctions.FIELD_ACCESS_NESTED,
serRecord[start]);
                         }
                     }
 
@@ -215,8 +211,9 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                         }
 
                         subTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[subFieldOffset]);
-                        subFieldLength = NonTaggedFormatUtil.getFieldValueLength(serRecord,
subFieldOffset, subTypeTag,
-                                true) + 1;
+                        subFieldLength =
+                                NonTaggedFormatUtil.getFieldValueLength(serRecord, subFieldOffset,
subTypeTag, true)
+                                        + 1;
 
                         if (pathIndex >= fieldPointables.length - 1) {
                             continue;
@@ -232,8 +229,8 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                             return;
                         }
                         if (serRecord[start] != ATypeTag.SERIALIZED_RECORD_TYPE_TAG) {
-                                throw new UnsupportedTypeException(
-                                    BuiltinFunctions.FIELD_ACCESS_NESTED.getName(), serRecord[start]);
+                            throw new UnsupportedTypeException(BuiltinFunctions.FIELD_ACCESS_NESTED.getName(),
+                                    serRecord[start]);
                         }
                     }
                     // emit the final result.
@@ -244,8 +241,8 @@ public class FieldAccessNestedEvalFactory implements IScalarEvaluatorFactory
{
                         out.write(serRecord, subFieldOffset, subFieldLength);
                         result.set(resultStorage);
                     }
-                } catch (IOException | AsterixException e) {
-                    throw new HyracksDataException(e);
+                } 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/records/GetRecordFieldValueEvalFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
index c162e3d..95fb91a 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/records/GetRecordFieldValueEvalFactory.java
@@ -21,9 +21,7 @@ package org.apache.asterix.runtime.evaluators.functions.records;
 import java.io.DataOutput;
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.dataflow.data.nontagged.serde.ARecordSerializerDeserializer;
-import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.om.functions.BuiltinFunctions;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.types.ATypeTag;
@@ -31,6 +29,7 @@ import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.asterix.om.types.runtime.RuntimeRecordTypeInfo;
 import org.apache.asterix.om.utils.NonTaggedFormatUtil;
 import org.apache.asterix.om.utils.RecordUtil;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 import org.apache.hyracks.api.context.IHyracksTaskContext;
@@ -107,8 +106,8 @@ public class GetRecordFieldValueEvalFactory implements IScalarEvaluatorFactory
{
                             return;
                         }
                         ATypeTag fieldTypeTag = recordType.getFieldTypes()[subFieldIndex].getTypeTag();
-                        subFieldLength = NonTaggedFormatUtil.getFieldValueLength(serRecord,
subFieldOffset,
-                                fieldTypeTag, false);
+                        subFieldLength =
+                                NonTaggedFormatUtil.getFieldValueLength(serRecord, subFieldOffset,
fieldTypeTag, false);
                         // write result.
                         out.writeByte(fieldTypeTag.serialize());
                         out.write(serRecord, subFieldOffset, subFieldLength);
@@ -125,16 +124,15 @@ public class GetRecordFieldValueEvalFactory implements IScalarEvaluatorFactory
{
                         return;
                     }
                     // Get the field length.
-                    ATypeTag fieldValueTypeTag = EnumDeserializer.ATYPETAGDESERIALIZER
-                            .deserialize(serRecord[subFieldOffset]);
-                    subFieldLength = NonTaggedFormatUtil.getFieldValueLength(serRecord, subFieldOffset,
-                            fieldValueTypeTag, true) + 1;
+                    ATypeTag fieldValueTypeTag =
+                            EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serRecord[subFieldOffset]);
+                    subFieldLength =
+                            NonTaggedFormatUtil.getFieldValueLength(serRecord, subFieldOffset,
fieldValueTypeTag, true)
+                                    + 1;
                     // write result.
                     result.set(serRecord, subFieldOffset, subFieldLength);
                 } 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/operators/std/FlushDatasetOperatorDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/FlushDatasetOperatorDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/FlushDatasetOperatorDescriptor.java
index 85e92c3..3957c06 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/FlushDatasetOperatorDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/FlushDatasetOperatorDescriptor.java
@@ -20,8 +20,8 @@ package org.apache.asterix.runtime.operators.std;
 
 import java.nio.ByteBuffer;
 
-import org.apache.asterix.common.api.INcApplicationContext;
 import org.apache.asterix.common.api.IDatasetLifecycleManager;
+import org.apache.asterix.common.api.INcApplicationContext;
 import org.apache.asterix.common.exceptions.ACIDException;
 import org.apache.asterix.common.transactions.DatasetId;
 import org.apache.asterix.common.transactions.ILockManager;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/NoTupleSourceRuntimeFactory.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/NoTupleSourceRuntimeFactory.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/NoTupleSourceRuntimeFactory.java
deleted file mode 100644
index 377ad60..0000000
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/operators/std/NoTupleSourceRuntimeFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.asterix.runtime.operators.std;
-
-import org.apache.hyracks.algebricks.runtime.base.IPushRuntime;
-import org.apache.hyracks.algebricks.runtime.base.IPushRuntimeFactory;
-import org.apache.hyracks.algebricks.runtime.operators.base.AbstractOneInputSourcePushRuntime;
-import org.apache.hyracks.api.context.IHyracksTaskContext;
-import org.apache.hyracks.api.exceptions.HyracksDataException;
-
-public class NoTupleSourceRuntimeFactory implements IPushRuntimeFactory {
-
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public String toString() {
-        return "nts";
-    }
-
-    @Override
-    public IPushRuntime createPushRuntime(IHyracksTaskContext ctx) {
-        return new AbstractOneInputSourcePushRuntime() {
-
-            @Override
-            public void open() throws HyracksDataException {
-                try {
-                    writer.open();
-                } finally {
-                    writer.close();
-                }
-            }
-
-        };
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
index 8ee10dc..3409e61 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/ScanCollectionDescriptor.java
@@ -21,13 +21,12 @@ package org.apache.asterix.runtime.unnestingfunctions.std;
 
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
-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;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.runtime.evaluators.common.ListAccessor;
+import org.apache.asterix.runtime.exceptions.TypeMismatchException;
 import org.apache.asterix.runtime.unnestingfunctions.base.AbstractUnnestingFunctionDynamicDescriptor;
 import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator;
@@ -112,9 +111,7 @@ public class ScanCollectionDescriptor extends AbstractUnnestingFunctionDynamicDe
                             }
                         }
                     } catch (IOException e) {
-                        throw new HyracksDataException(e);
-                    } catch (AsterixException e) {
-                        throw new HyracksDataException(e);
+                        throw HyracksDataException.create(e);
                     }
                     return false;
                 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/81799ab0/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
index 84a59ac..47fbc4f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/unnestingfunctions/std/SubsetCollectionDescriptor.java
@@ -20,7 +20,6 @@ package org.apache.asterix.runtime.unnestingfunctions.std;
 
 import java.io.IOException;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.exceptions.ErrorCode;
 import org.apache.asterix.common.exceptions.RuntimeDataException;
 import org.apache.asterix.dataflow.data.nontagged.serde.AOrderedListSerializerDeserializer;
@@ -80,8 +79,7 @@ public class SubsetCollectionDescriptor extends AbstractUnnestingFunctionDynamic
                         try {
                             evalStart.evaluate(tuple, inputVal);
                             posStart = ATypeHierarchy.getIntegerValue(getIdentifier().getName(),
0,
-                                    inputVal.getByteArray(),
-                                    inputVal.getStartOffset());
+                                    inputVal.getByteArray(), inputVal.getStartOffset());
 
                             evalLen.evaluate(tuple, inputVal);
                             numItems = ATypeHierarchy.getIntegerValue(getIdentifier().getName(),
1,
@@ -128,8 +126,8 @@ public class SubsetCollectionDescriptor extends AbstractUnnestingFunctionDynamic
                             int offset = inputVal.getStartOffset();
                             int itemLength = 0;
                             try {
-                                int itemOffset = AOrderedListSerializerDeserializer.getItemOffset(serList,
offset,
-                                        posCrt);
+                                int itemOffset =
+                                        AOrderedListSerializerDeserializer.getItemOffset(serList,
offset, posCrt);
                                 if (selfDescList) {
                                     itemTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(serList[itemOffset]);
                                 }
@@ -141,9 +139,7 @@ public class SubsetCollectionDescriptor extends AbstractUnnestingFunctionDynamic
                                 resultStorage.getDataOutput().write(serList, itemOffset,
                                         itemLength + (!selfDescList ? 0 : 1));
                             } catch (IOException e) {
-                                throw new HyracksDataException(e);
-                            } catch (AsterixException e) {
-                                throw new HyracksDataException(e);
+                                throw HyracksDataException.create(e);
                             }
                             result.set(resultStorage);
                             ++posCrt;


Mime
View raw message