public class NullIfDBFunctionSymbolImpl extends AbstractArgDependentTypedDBFunctionSymbol
FunctionSymbol.FunctionalTermNullability| Modifier and Type | Field and Description |
|---|---|
protected static String |
NULLIF_STR |
| Modifier | Constructor and Description |
|---|---|
protected |
NullIfDBFunctionSymbolImpl(DBTermType rootDBTermType) |
protected |
NullIfDBFunctionSymbolImpl(String name,
DBTermType rootDBTermType,
DBFunctionSymbolSerializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
protected ImmutableTerm |
buildTermAfterEvaluation(com.google.common.collect.ImmutableList<ImmutableTerm> newTerms,
TermFactory termFactory,
VariableNullability variableNullability)
By default, just build a new functional term.
|
boolean |
canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
Currently cannot be post-processed as we are not sure which kind of equality is considered by the DB engine
TODO: experiment
|
protected Map.Entry<ImmutableTerm,Stream<ImmutableTerm>> |
decomposeNullIfHierarchy(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
Decomposes hierarchies like NULLIF(NULLIF(x,1),0) into pairs like (x, [0,1])
|
IncrementalEvaluation |
evaluateIsNotNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory,
VariableNullability variableNullability)
Default implementation, can be overridden
|
protected Stream<? extends ImmutableTerm> |
extractPossibleValues(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms) |
String |
getNativeDBString(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
Function<ImmutableTerm,String> termConverter,
TermFactory termFactory)
Returns a String in the native query language.
|
boolean |
isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms()
When the function symbol is, in the absence of non-injective functional sub-terms, sometimes but not always injective,
please override isInjective(...)
|
boolean |
isPreferringToBePostProcessedOverBeingBlocked()
If it is better to be post-processed than being blocked behind an UNION.
|
protected boolean |
mayReturnNullWithoutNullArguments()
Returns false when a functional term with this symbol:
1.
|
FunctionalTermSimplification |
simplifyAsGuaranteedToBeNonNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms,
TermFactory termFactory)
If guaranteed to be non-null, only considers the first term.
|
protected boolean |
tolerateNulls()
Returns true if is not guaranteed to return NULL when one argument is NULL.
|
inferTypeanalyzeInjectivity, canBeSafelyDecomposedIntoConjunction, decomposeInjectiveTopFunctionalTerm, enableIfElseNullLifting, evaluateNullability, evaluateStrictEq, evaluateStrictEqWithFunctionalTerm, evaluateStrictEqWithNonNullConstant, getExpectedBaseType, getExpectedBaseTypes, isAggregation, isDeterministic, isInjective, isNullable, proposeProvenanceVariables, simplify, transformIntoRegularArguments, tryToLiftMagicNumbersequals, getArity, getName, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitanalyzeInjectivity, evaluateNullability, evaluateStrictEq, getExpectedBaseType, isAggregation, isDeterministic, isNullable, proposeProvenanceVariables, simplifyprotected static final String NULLIF_STR
protected NullIfDBFunctionSymbolImpl(String name, DBTermType rootDBTermType, DBFunctionSymbolSerializer serializer)
protected NullIfDBFunctionSymbolImpl(DBTermType rootDBTermType)
protected Stream<? extends ImmutableTerm> extractPossibleValues(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
extractPossibleValues in class AbstractArgDependentTypedDBFunctionSymbolpublic boolean isPreferringToBePostProcessedOverBeingBlocked()
DBFunctionSymbolpublic String getNativeDBString(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, Function<ImmutableTerm,String> termConverter, TermFactory termFactory)
DBFunctionSymbolSerializerprotected boolean tolerateNulls()
FunctionSymbolImpltolerateNulls in class FunctionSymbolImplprotected boolean mayReturnNullWithoutNullArguments()
FunctionSymbolImplmayReturnNullWithoutNullArguments in class FunctionSymbolImplpublic boolean isAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms()
FunctionSymbolImplisAlwaysInjectiveInTheAbsenceOfNonInjectiveFunctionalTerms in class FunctionSymbolImplpublic boolean canBePostProcessed(com.google.common.collect.ImmutableList<? extends ImmutableTerm> arguments)
protected ImmutableTerm buildTermAfterEvaluation(com.google.common.collect.ImmutableList<ImmutableTerm> newTerms, TermFactory termFactory, VariableNullability variableNullability)
FunctionSymbolImplbuildTermAfterEvaluation in class FunctionSymbolImplpublic IncrementalEvaluation evaluateIsNotNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory, VariableNullability variableNullability)
FunctionSymbolImplevaluateIsNotNull in interface FunctionSymbolevaluateIsNotNull in class FunctionSymbolImplprotected Map.Entry<ImmutableTerm,Stream<ImmutableTerm>> decomposeNullIfHierarchy(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms)
public FunctionalTermSimplification simplifyAsGuaranteedToBeNonNull(com.google.common.collect.ImmutableList<? extends ImmutableTerm> terms, TermFactory termFactory)
simplifyAsGuaranteedToBeNonNull in interface FunctionSymbolsimplifyAsGuaranteedToBeNonNull in class FunctionSymbolImplCopyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.