Search in sources :

Example 16 with AOrderedListType

use of org.apache.asterix.om.types.AOrderedListType in project asterixdb by apache.

the class TweetParserTest method closedRecordTypeTest.

@Test
public void closedRecordTypeTest() throws IOException, URISyntaxException {
    // contruct type
    IAType geoFieldType = new ARecordType("GeoType", new String[] { "coordinates" }, new IAType[] { new AOrderedListType(AFLOAT, "point") }, true);
    ARecordType tweetRecordType = new ARecordType("TweetType", new String[] { "id", "geo" }, new IAType[] { AINT64, geoFieldType }, true);
    TweetParser parser = new TweetParser(tweetRecordType);
    List<String> lines = Files.readAllLines(Paths.get(getClass().getResource("/test_tweets.txt").toURI()));
    ByteArrayOutputStream is = new ByteArrayOutputStream();
    DataOutput output = new DataOutputStream(is);
    int regularCount = 0;
    for (int iter1 = 0; iter1 < lines.size(); iter1++) {
        GenericRecord<String> record = new GenericRecord<>();
        record.set(lines.get(iter1));
        try {
            parser.parse(record, output);
            regularCount++;
        } catch (HyracksDataException e) {
            Assert.assertTrue(e.toString().contains("Non-null") && (iter1 == 0 || iter1 == 1));
        }
    }
    Assert.assertTrue(regularCount == 4);
}
Also used : DataOutput(java.io.DataOutput) DataOutputStream(java.io.DataOutputStream) AOrderedListType(org.apache.asterix.om.types.AOrderedListType) ByteArrayOutputStream(java.io.ByteArrayOutputStream) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) TweetParser(org.apache.asterix.external.parser.TweetParser) GenericRecord(org.apache.asterix.external.input.record.GenericRecord) ARecordType(org.apache.asterix.om.types.ARecordType) IAType(org.apache.asterix.om.types.IAType) Test(org.junit.Test)

Example 17 with AOrderedListType

use of org.apache.asterix.om.types.AOrderedListType in project asterixdb by apache.

the class LineRectanglePolygonAccessor method createEvaluatorFactory.

@Override
public IScalarEvaluatorFactory createEvaluatorFactory(final IScalarEvaluatorFactory[] args) {
    return new IScalarEvaluatorFactory() {

        private static final long serialVersionUID = 1L;

        @Override
        public IScalarEvaluator createScalarEvaluator(IHyracksTaskContext ctx) throws HyracksDataException {
            return new IScalarEvaluator() {

                private final ArrayBackedValueStorage resultStorage = new ArrayBackedValueStorage();

                private final DataOutput out = resultStorage.getDataOutput();

                private final IPointable argPtr = new VoidPointable();

                private final IScalarEvaluator eval = args[0].createScalarEvaluator(ctx);

                private final OrderedListBuilder listBuilder = new OrderedListBuilder();

                private final ArrayBackedValueStorage inputVal = new ArrayBackedValueStorage();

                private final AOrderedListType pointListType = new AOrderedListType(BuiltinType.APOINT, null);

                private final AMutablePoint aPoint = new AMutablePoint(0, 0);

                @SuppressWarnings("unchecked")
                private final ISerializerDeserializer<APoint> pointSerde = SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(BuiltinType.APOINT);

                @Override
                public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException {
                    eval.evaluate(tuple, argPtr);
                    byte[] bytes = argPtr.getByteArray();
                    int startOffset = argPtr.getStartOffset();
                    resultStorage.reset();
                    try {
                        if (bytes[startOffset] == ATypeTag.SERIALIZED_LINE_TYPE_TAG) {
                            listBuilder.reset(pointListType);
                            inputVal.reset();
                            double startX = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ALineSerializerDeserializer.getStartPointCoordinateOffset(Coordinate.X));
                            double startY = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ALineSerializerDeserializer.getStartPointCoordinateOffset(Coordinate.Y));
                            aPoint.setValue(startX, startY);
                            pointSerde.serialize(aPoint, inputVal.getDataOutput());
                            listBuilder.addItem(inputVal);
                            inputVal.reset();
                            double endX = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.X));
                            double endY = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ALineSerializerDeserializer.getEndPointCoordinateOffset(Coordinate.Y));
                            aPoint.setValue(endX, endY);
                            pointSerde.serialize(aPoint, inputVal.getDataOutput());
                            listBuilder.addItem(inputVal);
                            listBuilder.write(out, true);
                        } else if (bytes[startOffset] == ATypeTag.SERIALIZED_RECTANGLE_TYPE_TAG) {
                            listBuilder.reset(pointListType);
                            inputVal.reset();
                            double x1 = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ARectangleSerializerDeserializer.getBottomLeftCoordinateOffset(Coordinate.X));
                            double y1 = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ARectangleSerializerDeserializer.getBottomLeftCoordinateOffset(Coordinate.Y));
                            aPoint.setValue(x1, y1);
                            pointSerde.serialize(aPoint, inputVal.getDataOutput());
                            listBuilder.addItem(inputVal);
                            inputVal.reset();
                            double x2 = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ARectangleSerializerDeserializer.getUpperRightCoordinateOffset(Coordinate.X));
                            double y2 = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + ARectangleSerializerDeserializer.getUpperRightCoordinateOffset(Coordinate.Y));
                            aPoint.setValue(x2, y2);
                            pointSerde.serialize(aPoint, inputVal.getDataOutput());
                            listBuilder.addItem(inputVal);
                            listBuilder.write(out, true);
                        } else if (bytes[startOffset] == ATypeTag.SERIALIZED_POLYGON_TYPE_TAG) {
                            int numOfPoints = AInt16SerializerDeserializer.getShort(bytes, startOffset + APolygonSerializerDeserializer.getNumberOfPointsOffset());
                            if (numOfPoints < 3) {
                                throw new InvalidDataFormatException(getIdentifier(), ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
                            }
                            listBuilder.reset(pointListType);
                            for (int i = 0; i < numOfPoints; ++i) {
                                inputVal.reset();
                                double x = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + APolygonSerializerDeserializer.getCoordinateOffset(i, Coordinate.X));
                                double y = ADoubleSerializerDeserializer.getDouble(bytes, startOffset + APolygonSerializerDeserializer.getCoordinateOffset(i, Coordinate.Y));
                                aPoint.setValue(x, y);
                                pointSerde.serialize(aPoint, inputVal.getDataOutput());
                                listBuilder.addItem(inputVal);
                            }
                            listBuilder.write(out, true);
                        } else {
                            throw new TypeMismatchException(getIdentifier(), 0, bytes[startOffset], ATypeTag.SERIALIZED_LINE_TYPE_TAG, ATypeTag.SERIALIZED_RECTANGLE_TYPE_TAG, ATypeTag.SERIALIZED_POLYGON_TYPE_TAG);
                        }
                    } catch (IOException e) {
                        throw new HyracksDataException(e);
                    }
                    result.set(resultStorage);
                }
            };
        }
    };
}
Also used : DataOutput(java.io.DataOutput) OrderedListBuilder(org.apache.asterix.builders.OrderedListBuilder) AOrderedListType(org.apache.asterix.om.types.AOrderedListType) TypeMismatchException(org.apache.asterix.runtime.exceptions.TypeMismatchException) IPointable(org.apache.hyracks.data.std.api.IPointable) IOException(java.io.IOException) IScalarEvaluator(org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator) ISerializerDeserializer(org.apache.hyracks.api.dataflow.value.ISerializerDeserializer) APoint(org.apache.asterix.om.base.APoint) AMutablePoint(org.apache.asterix.om.base.AMutablePoint) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) IScalarEvaluatorFactory(org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory) InvalidDataFormatException(org.apache.asterix.runtime.exceptions.InvalidDataFormatException) ArrayBackedValueStorage(org.apache.hyracks.data.std.util.ArrayBackedValueStorage) IHyracksTaskContext(org.apache.hyracks.api.context.IHyracksTaskContext) VoidPointable(org.apache.hyracks.data.std.primitive.VoidPointable) IFrameTupleReference(org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference) AMutablePoint(org.apache.asterix.om.base.AMutablePoint)

Example 18 with AOrderedListType

use of org.apache.asterix.om.types.AOrderedListType in project asterixdb by apache.

the class DisjunctivePredicateToJoinRule method rewritePost.

@Override
public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
    MetadataProvider metadataProvider = (MetadataProvider) context.getMetadataProvider();
    if (metadataProvider.isBlockingOperatorDisabled()) {
        return false;
    }
    SelectOperator select;
    if ((select = asSelectOperator(opRef)) == null) {
        return false;
    }
    AbstractFunctionCallExpression condEx;
    if ((condEx = asFunctionCallExpression(select.getCondition(), AlgebricksBuiltinFunctions.OR)) == null) {
        return false;
    }
    List<Mutable<ILogicalExpression>> args = condEx.getArguments();
    VariableReferenceExpression varEx = null;
    IAType valType = null;
    HashSet<AsterixConstantValue> values = new HashSet<AsterixConstantValue>();
    for (Mutable<ILogicalExpression> arg : args) {
        AbstractFunctionCallExpression fctCall;
        if ((fctCall = asFunctionCallExpression(arg, AlgebricksBuiltinFunctions.EQ)) == null) {
            return false;
        }
        boolean haveConst = false;
        boolean haveVar = false;
        List<Mutable<ILogicalExpression>> fctArgs = fctCall.getArguments();
        for (Mutable<ILogicalExpression> fctArg : fctArgs) {
            final ILogicalExpression argExpr = fctArg.getValue();
            switch(argExpr.getExpressionTag()) {
                case CONSTANT:
                    haveConst = true;
                    AsterixConstantValue value = (AsterixConstantValue) ((ConstantExpression) argExpr).getValue();
                    if (valType == null) {
                        valType = value.getObject().getType();
                    } else if (!isCompatible(valType, value.getObject().getType())) {
                        return false;
                    }
                    values.add(value);
                    break;
                case VARIABLE:
                    haveVar = true;
                    final VariableReferenceExpression varArg = (VariableReferenceExpression) argExpr;
                    if (varEx == null) {
                        varEx = varArg;
                    } else if (!varEx.getVariableReference().equals(varArg.getVariableReference())) {
                        return false;
                    }
                    break;
                default:
                    return false;
            }
        }
        if (!(haveVar && haveConst)) {
            return false;
        }
    }
    AOrderedList list = new AOrderedList(new AOrderedListType(valType, "orderedlist"));
    for (AsterixConstantValue value : values) {
        list.add(value.getObject());
    }
    EmptyTupleSourceOperator ets = new EmptyTupleSourceOperator();
    context.computeAndSetTypeEnvironmentForOperator(ets);
    ILogicalExpression cExp = new ConstantExpression(new AsterixConstantValue(list));
    Mutable<ILogicalExpression> mutCExp = new MutableObject<>(cExp);
    IFunctionInfo scanFctInfo = BuiltinFunctions.getAsterixFunctionInfo(BuiltinFunctions.SCAN_COLLECTION);
    UnnestingFunctionCallExpression scanExp = new UnnestingFunctionCallExpression(scanFctInfo, mutCExp);
    LogicalVariable scanVar = context.newVar();
    UnnestOperator unn = new UnnestOperator(scanVar, new MutableObject<>(scanExp));
    unn.getInputs().add(new MutableObject<>(ets));
    context.computeAndSetTypeEnvironmentForOperator(unn);
    IFunctionInfo eqFctInfo = BuiltinFunctions.getAsterixFunctionInfo(AlgebricksBuiltinFunctions.EQ);
    AbstractFunctionCallExpression eqExp = new ScalarFunctionCallExpression(eqFctInfo);
    eqExp.getArguments().add(new MutableObject<>(new VariableReferenceExpression(scanVar)));
    eqExp.getArguments().add(new MutableObject<>(varEx.cloneExpression()));
    eqExp.getAnnotations().put(IndexedNLJoinExpressionAnnotation.INSTANCE, IndexedNLJoinExpressionAnnotation.INSTANCE);
    BroadcastExpressionAnnotation bcast = new BroadcastExpressionAnnotation();
    // Broadcast the OR predicates branch.
    bcast.setObject(BroadcastExpressionAnnotation.BroadcastSide.LEFT);
    eqExp.getAnnotations().put(BroadcastExpressionAnnotation.BROADCAST_ANNOTATION_KEY, bcast);
    InnerJoinOperator jOp = new InnerJoinOperator(new MutableObject<>(eqExp));
    jOp.getInputs().add(new MutableObject<>(unn));
    jOp.getInputs().add(select.getInputs().get(0));
    opRef.setValue(jOp);
    context.computeAndSetTypeEnvironmentForOperator(jOp);
    return true;
}
Also used : IFunctionInfo(org.apache.hyracks.algebricks.core.algebra.functions.IFunctionInfo) ConstantExpression(org.apache.hyracks.algebricks.core.algebra.expressions.ConstantExpression) InnerJoinOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.InnerJoinOperator) UnnestOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator) SelectOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator) AOrderedList(org.apache.asterix.om.base.AOrderedList) AsterixConstantValue(org.apache.asterix.om.constants.AsterixConstantValue) BroadcastExpressionAnnotation(org.apache.hyracks.algebricks.core.algebra.expressions.BroadcastExpressionAnnotation) EmptyTupleSourceOperator(org.apache.hyracks.algebricks.core.algebra.operators.logical.EmptyTupleSourceOperator) HashSet(java.util.HashSet) MutableObject(org.apache.commons.lang3.mutable.MutableObject) ScalarFunctionCallExpression(org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression) LogicalVariable(org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable) UnnestingFunctionCallExpression(org.apache.hyracks.algebricks.core.algebra.expressions.UnnestingFunctionCallExpression) AbstractFunctionCallExpression(org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression) AOrderedListType(org.apache.asterix.om.types.AOrderedListType) Mutable(org.apache.commons.lang3.mutable.Mutable) ILogicalExpression(org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression) MetadataProvider(org.apache.asterix.metadata.declared.MetadataProvider) VariableReferenceExpression(org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression) IAType(org.apache.asterix.om.types.IAType)

Example 19 with AOrderedListType

use of org.apache.asterix.om.types.AOrderedListType in project asterixdb by apache.

the class JTypeObjectFactory method create.

@Override
public IJObject create(IAType type) {
    IJObject retValue = null;
    switch(type.getTypeTag()) {
        case INTEGER:
            retValue = new JInt(0);
            break;
        case STRING:
            retValue = new JString("");
            break;
        case FLOAT:
            retValue = new JFloat(0);
            break;
        case DOUBLE:
            retValue = new JDouble(0);
            break;
        case BOOLEAN:
            retValue = new JBoolean(false);
            break;
        case CIRCLE:
            retValue = new JCircle(new JPoint(0, 0), 0);
            break;
        case POINT:
            retValue = new JPoint(0, 0);
            break;
        case POINT3D:
            retValue = new JPoint3D(0, 0, 0);
            break;
        case POLYGON:
            retValue = new JPolygon(new JPoint[] {});
            break;
        case LINE:
            retValue = new JLine(new JPoint(0, 0), new JPoint(0, 0));
            break;
        case RECTANGLE:
            retValue = new JRectangle(new JPoint(0, 0), new JPoint(1, 1));
            break;
        case DATE:
            retValue = new JDate(0);
            break;
        case DATETIME:
            retValue = new JDateTime(0);
            break;
        case DURATION:
            retValue = new JDuration(0, 0);
            break;
        case INTERVAL:
            retValue = new JInterval(0, 0);
            break;
        case TIME:
            retValue = new JTime(0);
            break;
        case BIGINT:
            retValue = new JLong(0);
            break;
        case NULL:
            retValue = JObjects.JNull.INSTANCE;
            break;
        case MISSING:
            retValue = JObjects.JMissing.INSTANCE;
            break;
        case ARRAY:
            AOrderedListType ot = (AOrderedListType) type;
            IAType orderedItemType = ot.getItemType();
            IJObject orderedItemObject = create(orderedItemType);
            retValue = new JOrderedList(orderedItemObject);
            break;
        case MULTISET:
            AUnorderedListType ut = (AUnorderedListType) type;
            IAType unorderedItemType = ut.getItemType();
            IJObject unorderedItemObject = create(unorderedItemType);
            retValue = new JUnorderedList(unorderedItemObject);
            break;
        case OBJECT:
            IAType[] fieldTypes = ((ARecordType) type).getFieldTypes();
            IJObject[] fieldObjects = new IJObject[fieldTypes.length];
            int index = 0;
            for (IAType fieldType : fieldTypes) {
                fieldObjects[index] = create(fieldType);
                index++;
            }
            retValue = new JRecord((ARecordType) type, fieldObjects);
            break;
        case UNION:
            AUnionType unionType = (AUnionType) type;
            IJObject itemObject = null;
            if (unionType.isMissableType()) {
                itemObject = create(unionType);
            }
            retValue = itemObject;
            break;
        default:
            break;
    }
    return retValue;
}
Also used : JRecord(org.apache.asterix.external.library.java.JObjects.JRecord) JPoint(org.apache.asterix.external.library.java.JObjects.JPoint) AUnionType(org.apache.asterix.om.types.AUnionType) JRectangle(org.apache.asterix.external.library.java.JObjects.JRectangle) JPolygon(org.apache.asterix.external.library.java.JObjects.JPolygon) JInterval(org.apache.asterix.external.library.java.JObjects.JInterval) JTime(org.apache.asterix.external.library.java.JObjects.JTime) JLong(org.apache.asterix.external.library.java.JObjects.JLong) JDouble(org.apache.asterix.external.library.java.JObjects.JDouble) JBoolean(org.apache.asterix.external.library.java.JObjects.JBoolean) JDuration(org.apache.asterix.external.library.java.JObjects.JDuration) JFloat(org.apache.asterix.external.library.java.JObjects.JFloat) JCircle(org.apache.asterix.external.library.java.JObjects.JCircle) JInt(org.apache.asterix.external.library.java.JObjects.JInt) AOrderedListType(org.apache.asterix.om.types.AOrderedListType) IJObject(org.apache.asterix.external.api.IJObject) JLine(org.apache.asterix.external.library.java.JObjects.JLine) JDate(org.apache.asterix.external.library.java.JObjects.JDate) AUnorderedListType(org.apache.asterix.om.types.AUnorderedListType) JPoint(org.apache.asterix.external.library.java.JObjects.JPoint) JUnorderedList(org.apache.asterix.external.library.java.JObjects.JUnorderedList) JDateTime(org.apache.asterix.external.library.java.JObjects.JDateTime) JPoint3D(org.apache.asterix.external.library.java.JObjects.JPoint3D) JOrderedList(org.apache.asterix.external.library.java.JObjects.JOrderedList) JString(org.apache.asterix.external.library.java.JObjects.JString) ARecordType(org.apache.asterix.om.types.ARecordType) IAType(org.apache.asterix.om.types.IAType)

Example 20 with AOrderedListType

use of org.apache.asterix.om.types.AOrderedListType in project asterixdb by apache.

the class RecordAddFieldsTypeComputer method computeType.

@Override
public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env, IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException {
    AbstractFunctionCallExpression funcExpr = (AbstractFunctionCallExpression) expression;
    String funcName = funcExpr.getFunctionIdentifier().getName();
    IAType type0 = (IAType) env.getType(funcExpr.getArguments().get(0).getValue());
    ARecordType inputRecordType = TypeComputeUtils.extractRecordType(type0);
    if (inputRecordType == null) {
        throw new TypeMismatchException(funcName, 0, type0.getTypeTag(), ATypeTag.OBJECT);
    }
    ILogicalExpression arg1 = funcExpr.getArguments().get(1).getValue();
    IAType type1 = (IAType) env.getType(arg1);
    AOrderedListType inputOrderedListType = TypeComputeUtils.extractOrderedListType(type1);
    if (inputOrderedListType == null) {
        return inputRecordType;
    }
    boolean unknownable = TypeHelper.canBeUnknown(type0) || TypeHelper.canBeUnknown(type1);
    Map<String, IAType> additionalFields = new HashMap<>();
    List<String> resultFieldNames = new ArrayList<>();
    List<IAType> resultFieldTypes = new ArrayList<>();
    resultFieldNames.addAll(Arrays.asList(inputRecordType.getFieldNames()));
    Collections.sort(resultFieldNames);
    for (String fieldName : resultFieldNames) {
        if (inputRecordType.getFieldType(fieldName).getTypeTag() == ATypeTag.OBJECT) {
            ARecordType nestedType = (ARecordType) inputRecordType.getFieldType(fieldName);
            //Deep Copy prevents altering of input types
            resultFieldTypes.add(nestedType.deepCopy(nestedType));
        } else {
            resultFieldTypes.add(inputRecordType.getFieldType(fieldName));
        }
    }
    if (!containsVariable(arg1)) {
        AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) arg1;
        List<Mutable<ILogicalExpression>> args = f.getArguments();
        String fieldName = null;
        IAType fieldType = null;
        // Iterating through the orderlist input
        for (Mutable<ILogicalExpression> arg : args) {
            AbstractFunctionCallExpression recConsExpr = (AbstractFunctionCallExpression) arg.getValue();
            ARecordType rtype = TypeComputeUtils.extractRecordType((IAType) env.getType(recConsExpr));
            if (rtype != null) {
                String[] fn = rtype.getFieldNames();
                IAType[] ft = rtype.getFieldTypes();
                for (int j = 0; j < fn.length; j++) {
                    if (fn[j].equals(FIELD_NAME_NAME)) {
                        ILogicalExpression fieldNameExpr = recConsExpr.getArguments().get(j).getValue();
                        if (ConstantExpressionUtil.getStringConstant(fieldNameExpr) == null) {
                            throw new InvalidExpressionException(funcName, 1, fieldNameExpr, LogicalExpressionTag.CONSTANT);
                        }
                        // Get the actual "field-name" string
                        fieldName = ConstantExpressionUtil.getStringArgument(recConsExpr, j + 1);
                    } else if (fn[j].equals(FIELD_VALUE_VALUE)) {
                        fieldType = ft[j];
                    }
                }
                if (fieldName != null) {
                    additionalFields.put(fieldName, fieldType);
                }
            }
        }
        if (!additionalFields.isEmpty()) {
            Iterator<Map.Entry<String, IAType>> it = additionalFields.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry<String, IAType> entry = it.next();
                resultFieldNames.add(entry.getKey());
                resultFieldTypes.add(entry.getValue());
            }
        }
    }
    // If variable ignore, deal with the addition at runtime
    String resultTypeName = "appended(" + inputRecordType.getTypeName() + ")";
    int n = resultFieldNames.size();
    IAType resultType = new ARecordType(resultTypeName, resultFieldNames.toArray(new String[n]), resultFieldTypes.toArray(new IAType[n]), true);
    if (unknownable) {
        resultType = AUnionType.createUnknownableType(resultType);
    }
    return resultType;
}
Also used : HashMap(java.util.HashMap) AbstractFunctionCallExpression(org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression) TypeMismatchException(org.apache.asterix.om.exceptions.TypeMismatchException) AOrderedListType(org.apache.asterix.om.types.AOrderedListType) ArrayList(java.util.ArrayList) Mutable(org.apache.commons.lang3.mutable.Mutable) ILogicalExpression(org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression) InvalidExpressionException(org.apache.asterix.om.exceptions.InvalidExpressionException) ARecordType(org.apache.asterix.om.types.ARecordType) HashMap(java.util.HashMap) Map(java.util.Map) IAType(org.apache.asterix.om.types.IAType)

Aggregations

AOrderedListType (org.apache.asterix.om.types.AOrderedListType)26 IAType (org.apache.asterix.om.types.IAType)16 ARecordType (org.apache.asterix.om.types.ARecordType)13 ArrayList (java.util.ArrayList)9 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)8 OrderedListBuilder (org.apache.asterix.builders.OrderedListBuilder)7 DataOutput (java.io.DataOutput)6 AString (org.apache.asterix.om.base.AString)6 ArrayBackedValueStorage (org.apache.hyracks.data.std.util.ArrayBackedValueStorage)6 AOrderedList (org.apache.asterix.om.base.AOrderedList)5 AUnionType (org.apache.asterix.om.types.AUnionType)5 Test (org.junit.Test)5 IOException (java.io.IOException)4 ATypeTag (org.apache.asterix.om.types.ATypeTag)4 AUnorderedListType (org.apache.asterix.om.types.AUnorderedListType)4 TypeMismatchException (org.apache.asterix.runtime.exceptions.TypeMismatchException)4 IScalarEvaluator (org.apache.hyracks.algebricks.runtime.base.IScalarEvaluator)4 IScalarEvaluatorFactory (org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory)4 IHyracksTaskContext (org.apache.hyracks.api.context.IHyracksTaskContext)4 IPointable (org.apache.hyracks.data.std.api.IPointable)4