/** * 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; }
/** * 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; }
/** * 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; }
List<Function> mustPushSubexpression = null; for (Function function : functions) { if (function.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN || (EvaluatableVisitor.willBecomeConstant(function) && accessNode != null && CapabilitiesUtil.supports(Capability.SELECT_WITHOUT_FROM, modelId, metadata, capFinder))) { continue;
private void validateAggregateFunctionEvaluation(AggregateSymbol as) throws QueryPlannerException { if (as.getFunctionDescriptor() != null && as.getFunctionDescriptor().getPushdown() == PushDown.MUST_PUSHDOWN) { throw new QueryPlannerException(QueryPlugin.Event.TEIID31211, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31211, as.getFunctionDescriptor().getFullName())); } }
private void validateAggregateFunctionEvaluation(AggregateSymbol as) throws QueryPlannerException { if (as.getFunctionDescriptor() != null && as.getFunctionDescriptor().getPushdown() == PushDown.MUST_PUSHDOWN) { throw new QueryPlannerException(QueryPlugin.Event.TEIID31211, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31211, as.getFunctionDescriptor().getFullName())); } }
private void validateAggregateFunctionEvaluation(AggregateSymbol as) throws QueryPlannerException { if (as.getFunctionDescriptor() != null && as.getFunctionDescriptor().getPushdown() == PushDown.MUST_PUSHDOWN) { throw new QueryPlannerException(QueryPlugin.Event.TEIID31211, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31211, as.getFunctionDescriptor().getFullName())); } }
List<Function> mustPushSubexpression = null; for (Function function : functions) { if (function.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN || (EvaluatableVisitor.willBecomeConstant(function) && accessNode != null && CapabilitiesUtil.supports(Capability.SELECT_WITHOUT_FROM, modelId, metadata, capFinder))) { continue;
List<Function> mustPushSubexpression = null; for (Function function : functions) { if (function.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN || (EvaluatableVisitor.willBecomeConstant(function) && accessNode != null && CapabilitiesUtil.supports(Capability.SELECT_WITHOUT_FROM, modelId, metadata, capFinder))) { continue;
public void visit(Function obj) { FunctionDescriptor fd = obj.getFunctionDescriptor(); this.setDeterminismLevel(fd.getDeterministic()); if (fd.getDeterministic() == Determinism.NONDETERMINISTIC || fd.getPushdown() == PushDown.MUST_PUSHDOWN) { if (obj.isEval()) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else { evaluationNotPossible(EvaluationLevel.PUSH_DOWN); } } else if (obj.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP) //TODO: if we had the context here we could plan better for non-prepared requests || fd.getDeterministic().compareTo(Determinism.COMMAND_DETERMINISTIC) <= 0) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else if (fd.getProcedure() != null) { //a function defined by a procedure evaluationNotPossible(EvaluationLevel.PROCESSING); } }
public void visit(Function obj) { FunctionDescriptor fd = obj.getFunctionDescriptor(); this.setDeterminismLevel(fd.getDeterministic()); if (fd.getDeterministic() == Determinism.NONDETERMINISTIC || fd.getPushdown() == PushDown.MUST_PUSHDOWN) { if (obj.isEval()) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else { evaluationNotPossible(EvaluationLevel.PUSH_DOWN); } } else if (obj.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP) //TODO: if we had the context here we could plan better for non-prepared requests || fd.getDeterministic().compareTo(Determinism.COMMAND_DETERMINISTIC) <= 0) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else if (fd.getProcedure() != null) { //a function defined by a procedure evaluationNotPossible(EvaluationLevel.PROCESSING); } }
public void visit(Function obj) { FunctionDescriptor fd = obj.getFunctionDescriptor(); this.setDeterminismLevel(fd.getDeterministic()); if (fd.getDeterministic() == Determinism.NONDETERMINISTIC || fd.getPushdown() == PushDown.MUST_PUSHDOWN) { if (obj.isEval()) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else { evaluationNotPossible(EvaluationLevel.PUSH_DOWN); } } else if (obj.getName().equalsIgnoreCase(FunctionLibrary.LOOKUP) //TODO: if we had the context here we could plan better for non-prepared requests || fd.getDeterministic().compareTo(Determinism.COMMAND_DETERMINISTIC) <= 0) { evaluationNotPossible(EvaluationLevel.PROCESSING); } else if (fd.getProcedure() != null) { //a function defined by a procedure evaluationNotPossible(EvaluationLevel.PROCESSING); } }
if (fd.getPushdown() == PushDown.MUST_PUSHDOWN) { try { return evaluatePushdown(function, tuple, values);
if (fd.getPushdown() == PushDown.MUST_PUSHDOWN) { try { return evaluatePushdown(function, tuple, values);
@Override public void visit(Function f) { FunctionDescriptor fd = f.getFunctionDescriptor(); if (f.isEval()) { try { if (modelId != null && fd.getPushdown() == PushDown.MUST_PUSHDOWN && fd.getMethod() != null && CapabilitiesUtil.isSameConnector(modelId, fd.getMethod().getParent(), metadata, capFinder)) { f.setEval(false); } else if (fd.getDeterministic() == Determinism.NONDETERMINISTIC && CapabilitiesUtil.supportsScalarFunction(modelId, f, metadata, capFinder)) { f.setEval(false); } } catch (QueryMetadataException e) { throw new TeiidRuntimeException(e); } catch (TeiidComponentException e) { throw new TeiidRuntimeException(e); } } } @Override
@Override public void visit(Function f) { FunctionDescriptor fd = f.getFunctionDescriptor(); if (f.isEval()) { try { if (modelId != null && fd.getPushdown() == PushDown.MUST_PUSHDOWN && fd.getMethod() != null && CapabilitiesUtil.isSameConnector(modelId, fd.getMethod().getParent(), metadata, capFinder)) { f.setEval(false); } else if (fd.getDeterministic() == Determinism.NONDETERMINISTIC && CapabilitiesUtil.supportsScalarFunction(modelId, f, metadata, capFinder)) { f.setEval(false); } } catch (QueryMetadataException e) { throw new TeiidRuntimeException(e); } catch (TeiidComponentException e) { throw new TeiidRuntimeException(e); } } } @Override
if (!(obj instanceof AggregateSymbol)) { Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
if (!(obj instanceof AggregateSymbol)) { Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
if (!(obj instanceof AggregateSymbol)) { Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
public void visit(Function obj) { try { if(obj.getFunctionDescriptor().getPushdown() == PushDown.CANNOT_PUSHDOWN) {