public class DefaultDBIfElseNullFunctionSymbol extends AbstractDBIfThenFunctionSymbol implements DBIfElseNullFunctionSymbol
FunctionSymbol.FunctionalTermNullabilitydoOrderingMatter| Modifier | Constructor and Description |
|---|---|
protected |
DefaultDBIfElseNullFunctionSymbol(DBTermType dbBooleanType,
DBTermType rootDBTermType) |
protected |
DefaultDBIfElseNullFunctionSymbol(String name,
DBTermType dbBooleanType,
DBTermType rootDBTermType) |
| Modifier and Type | Method and Description |
|---|---|
Optional<ImmutableFunctionalTerm.FunctionalTermDecomposition> |
analyzeInjectivity(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments,
com.google.common.collect.ImmutableSet<Variable> nonFreeVariables,
VariableNullability variableNullability,
VariableGenerator variableGenerator,
TermFactory termFactory)
To be overridden when is sometimes but not always injective in the absence of non-injective functional terms
|
boolean |
canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
Only looks if the second argument is guaranteed to be post-processed or not
since the first argument (the condition expression) will always be evaluated.
|
protected boolean |
canBeReplacedByValue(ImmutableExpression conditionExpression,
ImmutableTerm possibleValue,
TermFactory termFactory)
When the condition is only composed of IS_NOT_NULL expressions, see if the IF_ELSE_NULL(...) can be replaced
by its "then" value
TODO: group together terms that are known to be nullable together to detect more cases
|
IncrementalEvaluation |
evaluateIsNotNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, can be overridden
|
protected ImmutableTerm |
extractDefaultValue(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory) |
String |
getNativeDBString(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
Function<ImmutableTerm,String> termConverter,
TermFactory termFactory)
Returns a String in the native query language.
|
ImmutableExpression |
liftUnaryBooleanFunctionSymbol(com.google.common.collect.ImmutableList<? extends ImmutableTerm> ifElseNullTerms,
BooleanFunctionSymbol unaryBooleanFunctionSymbol,
TermFactory termFactory)
Returns BOOL_IF_ELSE_NULL(c, f(v)) where f is an unary BooleanFunctionSymbol, and c and v and the initial terms
|
ImmutableExpression |
pushDownExpression(ImmutableExpression expression,
int indexOfDBIfThenFunctionSymbol,
TermFactory termFactory)
Pushes a unary boolean function symbol down to the "then" arguments
For instance, f(CASE(c1, t1, c2, t2, t3), t4) -> BOOL_CASE(c1, f(t1,t4), c2, f(t2,t4), f(t3,t4))
|
protected ImmutableTerm |
simplify(ImmutableExpression newCondition,
ImmutableTerm newThenValue,
TermFactory termFactory,
VariableNullability variableNullability) |
ImmutableTerm |
simplify(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability) |
buildCase, extractPossibleValues, extractSubFunctionalTerms, isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms, isPreferringToBePostProcessedOverBeingBlocked, mayReturnNullWithoutNullArguments, pushDownFunctionalTerm, pushDownRegularFunctionalTerm, simplifyValue, tolerateNulls, transformIntoRegularArgumentsinferTypebuildTermAfterEvaluation, canBeSafelyDecomposedIntoConjunction, decomposeInjectiveTopFunctionalTerm, enableIfElseNullLifting, evaluateNullability, evaluateStrictEq, evaluateStrictEqWithFunctionalTerm, evaluateStrictEqWithNonNullConstant, getExpectedBaseType, getExpectedBaseTypes, isAggregation, isDeterministic, isInjective, isNullable, proposeProvenanceVariables, simplifyAsGuaranteedToBeNonNull, tryToLiftMagicNumbersclone, equals, getArity, getName, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitextractPossibleValues, pushDownRegularFunctionalTermisPreferringToBePostProcessedOverBeingBlockedevaluateNullability, evaluateStrictEq, getExpectedBaseType, inferType, isAggregation, isDeterministic, isNullable, proposeProvenanceVariables, simplifyAsGuaranteedToBeNonNullprotected DefaultDBIfElseNullFunctionSymbol(DBTermType dbBooleanType, DBTermType rootDBTermType)
protected DefaultDBIfElseNullFunctionSymbol(String name, DBTermType dbBooleanType, DBTermType rootDBTermType)
protected ImmutableTerm extractDefaultValue(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory)
extractDefaultValue in class AbstractDBIfThenFunctionSymbolpublic ImmutableTerm simplify(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
simplify in interface FunctionSymbolsimplify in class AbstractDBIfThenFunctionSymbolprotected ImmutableTerm simplify(ImmutableExpression newCondition, ImmutableTerm newThenValue, TermFactory termFactory, VariableNullability variableNullability)
protected boolean canBeReplacedByValue(ImmutableExpression conditionExpression, ImmutableTerm possibleValue, TermFactory termFactory)
public boolean canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
canBePostProcessed in interface FunctionSymbolcanBePostProcessed in class AbstractDBIfThenFunctionSymbolpublic String getNativeDBString(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
DBFunctionSymbolSerializergetNativeDBString in interface DBFunctionSymbolSerializerpublic ImmutableExpression liftUnaryBooleanFunctionSymbol(com.google.common.collect.ImmutableList<? extends ImmutableTerm> ifElseNullTerms, BooleanFunctionSymbol unaryBooleanFunctionSymbol, TermFactory termFactory)
DBIfElseNullFunctionSymbolliftUnaryBooleanFunctionSymbol in interface DBIfElseNullFunctionSymbolpublic IncrementalEvaluation evaluateIsNotNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
FunctionSymbolImplevaluateIsNotNull in interface FunctionSymbolevaluateIsNotNull in class FunctionSymbolImplpublic Optional<ImmutableFunctionalTerm.FunctionalTermDecomposition> analyzeInjectivity(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments, com.google.common.collect.ImmutableSet<Variable> nonFreeVariables, VariableNullability variableNullability, VariableGenerator variableGenerator, TermFactory termFactory)
FunctionSymbolImplanalyzeInjectivity in interface FunctionSymbolanalyzeInjectivity in class FunctionSymbolImplpublic ImmutableExpression pushDownExpression(ImmutableExpression expression, int indexOfDBIfThenFunctionSymbol, TermFactory termFactory)
DBIfThenFunctionSymbolpushDownExpression in interface DBIfThenFunctionSymbolpushDownExpression in class AbstractDBIfThenFunctionSymbolCopyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.