@Override protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException { IAType type = strippedInputTypes[0]; if (type.getTypeTag().isListType()) { return AUnionType.createNullableType(((AbstractCollectionType) type).getItemType()); } return BuiltinType.ANY; } }
@Override protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException { IAType argType = strippedInputTypes[0]; IAType outputType = resultType; if (!argType.getTypeTag().isListType() || isUnknownable(((AbstractCollectionType) argType).getItemType())) { outputType = AUnionType.createUnknownableType(outputType); } return outputType; }
return inValue != null && inValue.getType().getTypeTag().isListType() && ((IACollection) inValue).size() > 0; default:
@Override protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException { if (strippedInputTypes.length < 2) { String functionName = ((AbstractFunctionCallExpression) expr).getFunctionIdentifier().getName(); throw new CompilationException(ErrorCode.COMPILATION_INVALID_NUM_OF_ARGS, expr.getSourceLocation(), functionName); } IAType listType = strippedInputTypes[0]; if (listType.getTypeTag().isListType()) { listType = DefaultOpenFieldType.getDefaultOpenFieldType(listType.getTypeTag()); return AUnionType.createUnknownableType(listType); } else { return BuiltinType.ANY; } } }
|| !listTag.isListType()) { return RETURN_NULL; } else {
@Override protected IAType getResultType(ILogicalExpression expr, IAType... strippedInputTypes) throws AlgebricksException { if (isCheckArgumentsCount && (strippedInputTypes.length < minNumArgs || (maxNumArgs > 0 && strippedInputTypes.length > maxNumArgs))) { String functionName = ((AbstractFunctionCallExpression) expr).getFunctionIdentifier().getName(); throw new CompilationException(ErrorCode.COMPILATION_INVALID_NUM_OF_ARGS, expr.getSourceLocation(), functionName); } // output type should be the same as as the type tag at [list index]. The output type is nullable/missable // since the output could be null due to other invalid arguments or the tag at [list index] itself is not list int listIndex = 0; if (listIsLast) { listIndex = strippedInputTypes.length - 1; } IAType listType = strippedInputTypes[listIndex]; if (listType.getTypeTag().isListType()) { if (makeOpen) { listType = DefaultOpenFieldType.getDefaultOpenFieldType(listType.getTypeTag()); } return AUnionType.createUnknownableType(listType); } else { return BuiltinType.ANY; } }
private void process(ListAccessor listAccessor, IAsterixListBuilder listBuilder, int currentDepth, int depth) throws IOException { boolean itemInStorage; for (int i = 0; i < listAccessor.size(); i++) { itemInStorage = listAccessor.getOrWriteItem(i, item, storage); // if item is not a list or depth is reached, write it if (!ATYPETAGDESERIALIZER.deserialize(item.getByteArray()[item.getStartOffset()]).isListType() || currentDepth == depth) { listBuilder.addItem(item); } else { // recurse on the sublist ListAccessor newListAccessor = listAccessorAllocator.allocate(null); newListAccessor.reset(item.getByteArray(), item.getStartOffset()); if (itemInStorage) { // create a new storage since the item is using it storage = (ArrayBackedValueStorage) storageAllocator.allocate(null); storage.reset(); } process(newListAccessor, listBuilder, currentDepth + 1, depth); } } } }
|| !listType.isListType()) { PointableHelper.setNull(result); return;
int offset = listArg.getStartOffset(); ATypeTag listType = ATYPETAGDESERIALIZER.deserialize(listBytes[offset]); if (!listType.isListType()) { PointableHelper.setNull(result); return;
if (!ATYPETAGDESERIALIZER.deserialize(listBytes[listOffset]).isListType()) { PointableHelper.setNull(result); return;
if (!inputListType.getTypeTag().isListType()) { ATypeTag itemType = listAccessor.getItemType(); if (listAccessor.getListType() == ATypeTag.ARRAY) {
listArgType = listsArgs[i].getByteArray()[listsArgs[i].getStartOffset()]; listTag = ATYPETAGDESERIALIZER.deserialize(listArgType); if (!listTag.isListType()) { returnNull = true; } else if (outList != null && outList.getTypeTag() != listTag) {
if (!listType.isListType() || Math.floor(maxDouble) < maxDouble || targetTag == ATypeTag.NULL || Double.isInfinite(maxDouble) || Double.isNaN(maxDouble)) { PointableHelper.setNull(result);
if (!listTypetag.isListType() || !ATypeHierarchy.isCompatible(startPositionTypeTag, ATypeTag.DOUBLE)) { PointableHelper.setNull(result); return; if (!inputListType.getTypeTag().isListType()) {
listArgType = listArg.getByteArray()[listArg.getStartOffset()]; listTag = ATYPETAGDESERIALIZER.deserialize(listArgType); if (!listTag.isListType()) { returnNull = true; } else if (outList != null && outList.getTypeTag() != listTag) {
if (!listArgTag.isListType() || adjustedPosition == RETURN_NULL) { returnNull = true;