@Override public String toString() { return this.functionIdentifier.getNamespace() + ":" + this.functionIdentifier.getName() + "@" + this.functionIdentifier.getArity(); }
@Override public IScalarEvaluator createScalarEvaluator(final IHyracksTaskContext ctx) throws HyracksDataException { return new AbstractSubBinaryEvaluator(ctx, args, baseOffset, getIdentifier().getName(), sourceLoc) { @Override protected int getSubLength(IFrameTupleReference tuple) { return Integer.MAX_VALUE; } }; } };
@Override public IScalarEvaluator createScalarEvaluator(final IHyracksTaskContext ctx) throws HyracksDataException { return new AbstractFindBinaryEvaluator(ctx, args, baseOffset, getIdentifier().getName(), sourceLoc) { @Override protected int getFromOffset(IFrameTupleReference tuple) { return 0; } }; } };
public DatasetResourcesDatasource(INodeDomain domain, int datasetId) throws AlgebricksException { super(new DataSourceId(DatasetResourcesRewriter.DATASET_RESOURCES.getNamespace(), DatasetResourcesRewriter.DATASET_RESOURCES.getName()), domain); this.datasetId = datasetId; }
@Override public IScalarEvaluator createScalarEvaluator(final IHyracksTaskContext ctx) throws HyracksDataException { return new AbstractFindBinaryEvaluator(ctx, args, baseOffset, getIdentifier().getName(), sourceLoc) { @Override protected int getFromOffset(IFrameTupleReference tuple) throws HyracksDataException { return ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 2, pointables[2].getByteArray(), pointables[2].getStartOffset()) - baseOffset; } }; } };
public StorageComponentsDatasource(INodeDomain domain, int datasetId) throws AlgebricksException { super(new DataSourceId(StorageComponentsRewriter.STORAGE_COMPONENTS.getNamespace(), StorageComponentsRewriter.STORAGE_COMPONENTS.getName()), domain); this.datasetId = datasetId; }
@Override public IScalarEvaluator createScalarEvaluator(final IHyracksTaskContext ctx) throws HyracksDataException { return new AbstractSubBinaryEvaluator(ctx, args, baseOffset, getIdentifier().getName(), sourceLoc) { @Override protected int getSubLength(IFrameTupleReference tuple) throws HyracksDataException { return ATypeHierarchy.getIntegerValue(getIdentifier().getName(), 2, pointables[2].getByteArray(), pointables[2].getStartOffset()); } }; } };
public InvalidDataFormatException(SourceLocation sourceLoc, FunctionIdentifier fid, Throwable cause, byte expectedTypeTag) { super(ErrorCode.INVALID_FORMAT, sourceLoc, fid.getName(), cause, expectedTypeTag); addSuppressed(cause); }
public InvalidExpressionException(FunctionIdentifier fid, int index, ILogicalExpression actualExpr, LogicalExpressionTag... exprKinds) { super(ErrorCode.COMPILATION_INVALID_EXPRESSION, fid.getName(), indexToPosition(index), actualExpr.toString(), toExpectedTypeString(exprKinds)); }
public InvalidExpressionException(SourceLocation sourceLoc, FunctionIdentifier fid, int index, ILogicalExpression actualExpr, LogicalExpressionTag... exprKinds) { super(ErrorCode.COMPILATION_INVALID_EXPRESSION, sourceLoc, fid.getName(), indexToPosition(index), actualExpr.toString(), toExpectedTypeString(exprKinds)); }
public TypeMismatchException(SourceLocation sourceLoc, FunctionIdentifier fid, Integer i, byte actualTypeTag, String expectedType) { super(ErrorCode.TYPE_MISMATCH_FUNCTION, sourceLoc, fid.getName(), indexToPosition(i), expectedType, EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag)); }
@Override protected boolean evaluateTimeInstanceArithmetic(long chronon0, long chronon1, AMutableInt64 result) throws HyracksDataException { throw new UnsupportedTypeException(sourceLoc, getIdentifier().getName(), ATypeTag.SERIALIZED_TIME_TYPE_TAG); } }
public IncompatibleTypeException(SourceLocation sourceLoc, FunctionIdentifier fid, byte typeTagLeft, byte typeTagRight) { super(ErrorCode.TYPE_INCOMPATIBLE, sourceLoc, fid.getName(), EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagLeft), EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(typeTagRight)); }
@Override protected boolean evaluateTimeDurationArithmetic(long chronon, int yearMonth, long dayTime, boolean isTimeOnly, AMutableInt64 result) throws HyracksDataException { throw new UnsupportedTypeException(sourceLoc, getIdentifier().getName(), ATypeTag.SERIALIZED_DURATION_TYPE_TAG); }
public TypeMismatchException(FunctionIdentifier fid, Integer i, ATypeTag actualTypeTag, ATypeTag... expectedTypeTags) { super(ErrorCode.COMPILATION_TYPE_MISMATCH_FUNCTION, fid.getName(), indexToPosition(i), toExpectedTypeString(expectedTypeTags), actualTypeTag); }
public TypeMismatchException(SourceLocation sourceLoc, FunctionIdentifier fid, Integer i, ATypeTag actualTypeTag, ATypeTag... expectedTypeTags) { super(ErrorCode.COMPILATION_TYPE_MISMATCH_FUNCTION, sourceLoc, fid.getName(), indexToPosition(i), toExpectedTypeString(expectedTypeTags), actualTypeTag); }
@Override public IFunctionDescriptor lookupFunction(FunctionIdentifier fid) throws AlgebricksException { Pair<FunctionIdentifier, Integer> key = new Pair<>(fid, fid.getArity()); IFunctionDescriptorFactory factory = functions.get(key); if (factory == null) { throw new AlgebricksException("Inappropriate use of function " + "'" + fid.getName() + "'"); } return factory.createFunctionDescriptor(); }
public TypeMismatchException(FunctionIdentifier fid, Integer i, byte actualTypeTag, byte... expectedTypeTags) { super(ErrorCode.TYPE_MISMATCH_FUNCTION, fid.getName(), indexToPosition(i), toExpectedTypeString(expectedTypeTags), EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(actualTypeTag)); }
@Override public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env, IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException { AbstractFunctionCallExpression functionCallExpression = (AbstractFunctionCallExpression) expression; String funcName = functionCallExpression.getFunctionIdentifier().getName(); // Boolean type computer doesn't follow the null/missing-in/out semantics. return TypeComputeUtils.resolveResultType(expression, env, (index, type, sourceLoc) -> checkArgType(funcName, index, type, sourceLoc), this::getResultType, false); }
@Override public IAType computeType(ILogicalExpression expression, IVariableTypeEnvironment env, IMetadataProvider<?, ?> metadataProvider) throws AlgebricksException { AbstractFunctionCallExpression functionCallExpression = (AbstractFunctionCallExpression) expression; String funcName = functionCallExpression.getFunctionIdentifier().getName(); return TypeComputeUtils.resolveResultType(expression, env, (index, type, sourceLoc) -> checkArgType(funcName, index, type, sourceLoc), this::getResultType, propagateNullAndMissing()); }