public void visit(Function obj) { if (obj.getFunctionDescriptor() == null){ this.unresolvedSymbols.add(obj); } }
/** * Returns true if the expression is, or contains, any functions that cannot be pushed * down to the source * @param expression * @return * @since 4.2 */ private static boolean containsFunctionsThatCannotBePushed(Expression expression) { Iterator functions = FunctionCollectorVisitor.getFunctions(expression, true).iterator(); while (functions.hasNext()) { Function function = (Function)functions.next(); if (function.getFunctionDescriptor().getPushdown() == PushDown.CANNOT_PUSHDOWN) { return true; } } return false; }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
private void collectNotNull(Expression leftExpr, ArrayList<ElementSymbol> notNull) { if (leftExpr instanceof ElementSymbol) { notNull.add((ElementSymbol)leftExpr); } else if (leftExpr instanceof Function) { Function f = (Function)leftExpr; if (!f.getFunctionDescriptor().isNullDependent()) { for (Expression arg : f.getArgs()) { collectNotNull(arg, notNull); } } } }
private void collectNotNull(Expression leftExpr, ArrayList<ElementSymbol> notNull) { if (leftExpr instanceof ElementSymbol) { notNull.add((ElementSymbol)leftExpr); } else if (leftExpr instanceof Function) { Function f = (Function)leftExpr; if (!f.getFunctionDescriptor().isNullDependent()) { for (Expression arg : f.getArgs()) { collectNotNull(arg, notNull); } } } }
private void collectNotNull(Expression leftExpr, ArrayList<ElementSymbol> notNull) { if (leftExpr instanceof ElementSymbol) { notNull.add((ElementSymbol)leftExpr); } else if (leftExpr instanceof Function) { Function f = (Function)leftExpr; if (!f.getFunctionDescriptor().isNullDependent()) { for (Expression arg : f.getArgs()) { collectNotNull(arg, notNull); } } } }
protected Object evaluatePushdown(Function function, List<?> tuple, Object[] values) throws FunctionExecutionException, TeiidComponentException, TeiidProcessingException { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30341, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30341, function.getFunctionDescriptor().getFullName())); }
protected Object evaluatePushdown(Function function, List<?> tuple, Object[] values) throws FunctionExecutionException, TeiidComponentException, TeiidProcessingException { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30341, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30341, function.getFunctionDescriptor().getFullName())); }
protected Object evaluatePushdown(Function function, List<?> tuple, Object[] values) throws FunctionExecutionException, TeiidComponentException, TeiidProcessingException { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30341, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30341, function.getFunctionDescriptor().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); }
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); }
public Expression replaceExpression(Expression element) { if (element instanceof Function && !(element instanceof AggregateSymbol) && ((Function) element).isAggregate()) { Function f = (Function)element; AggregateSymbol as = new AggregateSymbol(f.getName(), false, f.getArgs(), null); as.setType(f.getType()); as.setFunctionDescriptor(f.getFunctionDescriptor()); return as; } return element; } };
public Expression replaceExpression(Expression element) { if (element instanceof Function && !(element instanceof AggregateSymbol) && ((Function) element).isAggregate()) { Function f = (Function)element; AggregateSymbol as = new AggregateSymbol(f.getName(), false, f.getArgs(), null); as.setType(f.getType()); as.setFunctionDescriptor(f.getFunctionDescriptor()); return as; } return element; } };
public Expression replaceExpression(Expression element) { if (element instanceof Function && !(element instanceof AggregateSymbol) && ((Function) element).isAggregate()) { Function f = (Function)element; AggregateSymbol as = new AggregateSymbol(f.getName(), false, f.getArgs(), null); as.setType(f.getType()); as.setFunctionDescriptor(f.getFunctionDescriptor()); return as; } return element; } };
/** * Return a deep copy of this object. * @return Deep copy of the object */ public Object clone() { Expression[] copyArgs = LanguageObject.Util.deepClone(this.args); Function copy = new Function(getName(), copyArgs); copy.setType(getType()); copy.setFunctionDescriptor(getFunctionDescriptor()); if(this.isImplicit()) { copy.makeImplicit(); } copy.eval = this.eval; return copy; }
/** * Return a deep copy of this object. * @return Deep copy of the object */ public Object clone() { Expression[] copyArgs = LanguageObject.Util.deepClone(this.args); Function copy = new Function(getName(), copyArgs); copy.setType(getType()); copy.setFunctionDescriptor(getFunctionDescriptor()); if(this.isImplicit()) { copy.makeImplicit(); } copy.eval = this.eval; return copy; }
/** * Return a deep copy of this object. * @return Deep copy of the object */ public Object clone() { Expression[] copyArgs = LanguageObject.Util.deepClone(this.args); Function copy = new Function(getName(), copyArgs); copy.setType(getType()); copy.setFunctionDescriptor(getFunctionDescriptor()); if(this.isImplicit()) { copy.makeImplicit(); } copy.eval = this.eval; return copy; }