@Override public boolean respectsNull() { return !fd.getMethod().isNullOnNull(); }
@Override public boolean respectsNull() { return !fd.getMethod().isNullOnNull(); }
@Override public boolean respectsNull() { return !fd.getMethod().isNullOnNull(); }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
public boolean isAggregate() { return getFunctionDescriptor().getMethod().getAggregateAttributes() != null; }
public boolean canStage() { if (orderBy != null) { return false; } switch (this.aggregate) { case TEXTAGG: case ARRAY_AGG: case JSONARRAY_AGG: case STRING_AGG: return false; case USER_DEFINED: return this.getArgs().length == 1 && this.getFunctionDescriptor().getMethod().getAggregateAttributes().isDecomposable(); } return true; }
public boolean canStage() { if (orderBy != null) { return false; } switch (this.aggregate) { case TEXTAGG: case ARRAY_AGG: case JSONARRAY_AGG: case STRING_AGG: return false; case USER_DEFINED: return this.getArgs().length == 1 && this.getFunctionDescriptor().getMethod().getAggregateAttributes().isDecomposable(); } return true; }
public boolean canStage() { if (orderBy != null) { return false; } switch (this.aggregate) { case TEXTAGG: case ARRAY_AGG: case JSONARRAY_AGG: case STRING_AGG: return false; case USER_DEFINED: return this.getArgs().length == 1 && this.getFunctionDescriptor().getMethod().getAggregateAttributes().isDecomposable(); } return true; }
public boolean isCardinalityDependent() { if (isDistinct()) { return false; } switch (getAggregateFunction()) { case MAX: case MIN: case ANY: case SOME: case EVERY: return false; case USER_DEFINED: return !getFunctionDescriptor().getMethod().getAggregateAttributes().usesDistinctRows(); } return true; }
public boolean isCardinalityDependent() { if (isDistinct()) { return false; } switch (getAggregateFunction()) { case MAX: case MIN: case ANY: case SOME: case EVERY: return false; case USER_DEFINED: return !getFunctionDescriptor().getMethod().getAggregateAttributes().usesDistinctRows(); } return true; }
public boolean isCardinalityDependent() { if (isDistinct()) { return false; } switch (getAggregateFunction()) { case MAX: case MIN: case ANY: case SOME: case EVERY: return false; case USER_DEFINED: return !getFunctionDescriptor().getMethod().getAggregateAttributes().usesDistinctRows(); } return true; }
@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
AggregateFunction translate(AggregateSymbol symbol) { List<org.teiid.language.Expression> params = new ArrayList<org.teiid.language.Expression>(symbol.getArgs().length); for (Expression expression : symbol.getArgs()) { params.add(translate(expression)); } String name = symbol.getAggregateFunction().name(); if (symbol.getFunctionDescriptor() != null) { name = Symbol.getShortName(symbol.getFunctionDescriptor().getName()); } else if (symbol.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) { name = symbol.getName(); } else if (symbol.getAggregateFunction() == Type.COUNT_BIG && !supportsCountBig) { name = Type.COUNT.name(); } AggregateFunction af = new AggregateFunction(name, symbol.isDistinct(), params, symbol.getType()); af.setCondition(translate(symbol.getCondition())); af.setOrderBy(translate(symbol.getOrderBy(), false)); if (symbol.getFunctionDescriptor() != null) { af.setMetadataObject(symbol.getFunctionDescriptor().getMethod()); } return af; }
AggregateFunction translate(AggregateSymbol symbol) { List<org.teiid.language.Expression> params = new ArrayList<org.teiid.language.Expression>(symbol.getArgs().length); for (Expression expression : symbol.getArgs()) { params.add(translate(expression)); } String name = symbol.getAggregateFunction().name(); if (symbol.getFunctionDescriptor() != null) { name = Symbol.getShortName(symbol.getFunctionDescriptor().getName()); } else if (symbol.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) { name = symbol.getName(); } else if (symbol.getAggregateFunction() == Type.COUNT_BIG && !supportsCountBig) { name = Type.COUNT.name(); } AggregateFunction af = new AggregateFunction(name, symbol.isDistinct(), params, symbol.getType()); af.setCondition(translate(symbol.getCondition())); af.setOrderBy(translate(symbol.getOrderBy(), false)); if (symbol.getFunctionDescriptor() != null) { af.setMetadataObject(symbol.getFunctionDescriptor().getMethod()); } return af; }
if (expression.isDistinct() && expression.getAggregateFunction() == Type.USER_DEFINED && expression.getFunctionDescriptor().getMethod().getAggregateAttributes().usesDistinctRows()) { expression.setDistinct(false);