public void visit(AggregateSymbol obj) { if (obj.getFunctionDescriptor() != null) { this.setDeterminismLevel(obj.getFunctionDescriptor().getDeterministic()); } evaluationNotPossible(EvaluationLevel.PUSH_DOWN); }
public void visit(AggregateSymbol obj) { if (obj.getFunctionDescriptor() != null) { this.setDeterminismLevel(obj.getFunctionDescriptor().getDeterministic()); } evaluationNotPossible(EvaluationLevel.PUSH_DOWN); }
public void visit(AggregateSymbol obj) { if (obj.getFunctionDescriptor() != null) { this.setDeterminismLevel(obj.getFunctionDescriptor().getDeterministic()); } evaluationNotPossible(EvaluationLevel.PUSH_DOWN); }
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); } }
Thread.currentThread().setContextClassLoader(originalCL); if (context != null && getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) { context.setDeterminismLevel(getDeterministic());
Thread.currentThread().setContextClassLoader(originalCL); if (context != null && getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) { context.setDeterminismLevel(getDeterministic());
Thread.currentThread().setContextClassLoader(originalCL); if (context != null && getDeterministic().ordinal() <= Determinism.USER_DETERMINISTIC.ordinal()) { context.setDeterminismLevel(getDeterministic());
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
@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
Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
Function f = (Function)obj; if (f.getFunctionDescriptor().getPushdown() != PushDown.MUST_PUSHDOWN && f.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { return; //don't need to consider
if (rawExpr instanceof Function) { Function function = (Function)rawExpr; if (function.getArgs().length == 0 && function.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { newStats[Stat.NDV.ordinal()] = 1; newStats[Stat.NDV_HIGH.ordinal()] = 1;
if (rawExpr instanceof Function) { Function function = (Function)rawExpr; if (function.getArgs().length == 0 && function.getFunctionDescriptor().getDeterministic() != Determinism.NONDETERMINISTIC) { newStats[Stat.NDV.ordinal()] = 1; newStats[Stat.NDV_HIGH.ordinal()] = 1;
&& 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);