protected IFunctionDescriptor createCastFunction(boolean strictCast) throws AlgebricksException { IFunctionDescriptor castFuncDesc = metadataProvider.getFunctionManager() .lookupFunction(strictCast ? BuiltinFunctions.CAST_TYPE : BuiltinFunctions.CAST_TYPE_LAX); castFuncDesc.setSourceLocation(sourceLoc); castFuncDesc.setImmutableStates(enforcedItemType, itemType); return castFuncDesc; }
private IFunctionDescriptor resolveFunction(AbstractFunctionCallExpression expr, IVariableTypeEnvironment env, JobGenContext context) throws AlgebricksException { FunctionIdentifier fnId = expr.getFunctionIdentifier(); IFunctionDescriptor fd = functionManager.lookupFunction(fnId); fd.setSourceLocation(expr.getSourceLocation()); IFunctionTypeInferer fnTypeInfer = functionManager.lookupFunctionTypeInferer(fnId); if (fnTypeInfer != null) { CompilerProperties compilerProps = ((IApplicationContext) context.getAppContext()).getCompilerProperties(); fnTypeInfer.infer(expr, fd, env, compilerProps); } return fd; } }
new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(), abvs.getLength())); IFunctionDescriptor fDesc = functionManager.lookupFunction(BuiltinFunctions.FIELD_ACCESS_BY_INDEX); fDesc.setSourceLocation(sourceLoc); fDesc.setImmutableStates(recType); return fDesc.createEvaluatorFactory( new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(), abvs.getLength())); IFunctionDescriptor fDesc = functionManager.lookupFunction(BuiltinFunctions.FIELD_ACCESS_BY_NAME); fDesc.setSourceLocation(sourceLoc); return fDesc.createEvaluatorFactory( new IScalarEvaluatorFactory[] { recordEvalFactory, fldNameEvalFactory }); fDesc.setSourceLocation(sourceLoc); fDesc.setImmutableStates(recType, fldName); return fDesc.createEvaluatorFactory(new IScalarEvaluatorFactory[] { recordEvalFactory });
new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(), abvs.getLength())); IFunctionDescriptor fDesc = functionManager.lookupFunction(BuiltinFunctions.FIELD_ACCESS_BY_INDEX); fDesc.setSourceLocation(sourceLoc); fDesc.setImmutableStates(recType); IScalarEvaluatorFactory evalFactory = fDesc.createEvaluatorFactory( fDesc.setSourceLocation(sourceLoc); fDesc.setImmutableStates(recType, fldName); IScalarEvaluatorFactory evalFactory =