context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType(), context); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
static Expression op(String op, Expression expr1, Expression expr2, FunctionLibrary functionLibrary) { if (expr1 == null) { return expr2; } if (expr2 == null) { return expr1; } Function newExpr = new Function(op, new Expression[] {expr1, expr2}); newExpr.setFunctionDescriptor(functionLibrary.findFunction(op, new Class[] {DataTypeManager.DefaultDataClasses.INTEGER, DataTypeManager.DefaultDataClasses.INTEGER})); newExpr.setType(newExpr.getFunctionDescriptor().getReturnType()); return evaluateIfPossible(newExpr); }
static Expression op(String op, Expression expr1, Expression expr2, FunctionLibrary functionLibrary) { if (expr1 == null) { return expr2; } if (expr2 == null) { return expr1; } Function newExpr = new Function(op, new Expression[] {expr1, expr2}); newExpr.setFunctionDescriptor(functionLibrary.findFunction(op, new Class[] {DataTypeManager.DefaultDataClasses.INTEGER, DataTypeManager.DefaultDataClasses.INTEGER})); newExpr.setType(newExpr.getFunctionDescriptor().getReturnType()); return evaluateIfPossible(newExpr); }
context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType()); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType(), context); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
static Expression op(String op, Expression expr1, Expression expr2, FunctionLibrary functionLibrary) { if (expr1 == null) { return expr2; } if (expr2 == null) { return expr1; } Function newExpr = new Function(op, new Expression[] {expr1, expr2}); newExpr.setFunctionDescriptor(functionLibrary.findFunction(op, new Class[] {DataTypeManager.DefaultDataClasses.INTEGER, DataTypeManager.DefaultDataClasses.INTEGER})); newExpr.setType(newExpr.getFunctionDescriptor().getReturnType()); return evaluateIfPossible(newExpr); }
/** * Insert a conversion function at specified index. This is a convenience * method to insert a conversion into the function tree. * @param index Argument index to insert conversion function at * @param functionDescriptor Conversion function descriptor */ public void insertConversion(int index, FunctionDescriptor functionDescriptor) { // Get target type for conversion Class<?> t = functionDescriptor.getReturnType(); String typeName = DataTypeManager.getDataTypeName(t); // Pull old expression at index Expression newArg[] = new Expression[] { args[index], new Constant(typeName) }; // Replace old expression with new expression, using old as arg Function func = new Function(functionDescriptor.getName(), newArg); args[index] = func; // Set function descriptor and type of new function func.setFunctionDescriptor(functionDescriptor); func.setType(t); func.makeImplicit(); }
/** * Insert a conversion function at specified index. This is a convenience * method to insert a conversion into the function tree. * @param index Argument index to insert conversion function at * @param functionDescriptor Conversion function descriptor */ public void insertConversion(int index, FunctionDescriptor functionDescriptor) { // Get target type for conversion Class<?> t = functionDescriptor.getReturnType(); String typeName = DataTypeManager.getDataTypeName(t); // Pull old expression at index Expression newArg[] = new Expression[] { args[index], new Constant(typeName) }; // Replace old expression with new expression, using old as arg Function func = new Function(functionDescriptor.getName(), newArg); args[index] = func; // Set function descriptor and type of new function func.setFunctionDescriptor(functionDescriptor); func.setType(t); func.makeImplicit(); }
/** * Insert a conversion function at specified index. This is a convenience * method to insert a conversion into the function tree. * @param index Argument index to insert conversion function at * @param functionDescriptor Conversion function descriptor */ public void insertConversion(int index, FunctionDescriptor functionDescriptor) { // Get target type for conversion Class<?> t = functionDescriptor.getReturnType(); String typeName = DataTypeManager.getDataTypeName(t); // Pull old expression at index Expression newArg[] = new Expression[] { args[index], new Constant(typeName) }; // Replace old expression with new expression, using old as arg Function func = new Function(functionDescriptor.getName(), newArg); args[index] = func; // Set function descriptor and type of new function func.setFunctionDescriptor(functionDescriptor); func.setType(t); func.makeImplicit(); }
try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) { throw new QueryValidatorException(QueryPlugin.Event.TEIID30373, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30373, e.getMessage()));
try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) { throw new QueryValidatorException(QueryPlugin.Event.TEIID30373, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30373, e.getMessage()));
try { Object result = descriptor.invokeFunction(new Object[] { const2.getValue(), const1.getValue() }, null, this.context ); combinedConst = new Constant(result, descriptor.getReturnType()); } catch(FunctionExecutionException e) { throw new QueryValidatorException(QueryPlugin.Event.TEIID30373, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30373, e.getMessage()));
newType = conversions[i].getReturnType();
newType = conversions[i].getReturnType();
newType = conversions[i].getReturnType();
return null; return this.getFunctionDescriptor().getReturnType(); case JSONARRAY_AGG: return DataTypeManager.DefaultDataClasses.CLOB;
command.setProcessorPlan(new SimpleProcessorPlan(command, schema, fd, Arrays.asList(new Constant(null, fd.getReturnType())))); } else { ((Function)((ExpressionSymbol)ss.getCommand().getProjectedSymbols().get(0)).getExpression()).setArgs(functionArgs);
command.setProcessorPlan(new SimpleProcessorPlan(command, schema, fd, Arrays.asList(new Constant(null, fd.getReturnType())))); } else { ((Function)((ExpressionSymbol)ss.getCommand().getProjectedSymbols().get(0)).getExpression()).setArgs(functionArgs);
command.setProcessorPlan(new SimpleProcessorPlan(command, schema, fd, Arrays.asList(new Constant(null, fd.getReturnType())))); } else { ((Function)((ExpressionSymbol)ss.getCommand().getProjectedSymbols().get(0)).getExpression()).setArgs(functionArgs);
function.setType(fd.getReturnType()); if (CoreConstants.SYSTEM_MODEL.equals(fd.getSchema())) { if (StringUtil.startsWithIgnoreCase(function.getName(), SYS_PREFIX)) {