public class UnwrapCastInComparison extends ExpressionRewriteRuleSet
CAST(s as T) = tinto
s = CAST(t as S)For example:
CAST(x AS bigint) = bigint '1'turns into
x = smallint '1'It can simplify expressions that are known to be true or false, and remove the comparisons altogether. For example, give x::smallint, for an expression like:
CAST(x AS bigint) > bigint '10000000'
ExpressionRewriteRuleSet.ExpressionRewriter| Constructor and Description |
|---|
UnwrapCastInComparison(Metadata metadata,
TypeAnalyzer typeAnalyzer) |
aggregationExpressionRewrite, applyExpressionRewrite, filterExpressionRewrite, joinExpressionRewrite, projectExpressionRewrite, rules, valuesExpressionRewritepublic UnwrapCastInComparison(Metadata metadata, TypeAnalyzer typeAnalyzer)
Copyright © 2012–2019. All rights reserved.