Class PushCastIntoRow
java.lang.Object
io.trino.sql.planner.iterative.rule.ExpressionRewriteRuleSet
io.trino.sql.planner.iterative.rule.PushCastIntoRow
Transforms expressions of the form
CAST(
CAST(
ROW(x, y)
AS row(f1 type1, f2 type2))
AS row(g1 type3, g2 type4))
to
CAST(
ROW(
CAST(x AS type1),
CAST(y AS type2))
AS row(g1 type3, g2 type4))
Note: it preserves the top-level CAST if the row type has field names because the names are needed by the ROW to JSON cast
TODO: ideally, the types involved in ROW to JSON cast should be captured at analysis time and
remain fixed for the duration of the optimization process so as to have flexibility in terms
of removing field names, which are irrelevant in the IR-
Nested Class Summary
Nested classes/interfaces inherited from class io.trino.sql.planner.iterative.rule.ExpressionRewriteRuleSet
ExpressionRewriteRuleSet.ExpressionRewriter -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.trino.sql.planner.iterative.rule.ExpressionRewriteRuleSet
aggregationExpressionRewrite, filterExpressionRewrite, joinExpressionRewrite, patternRecognitionExpressionRewrite, projectExpressionRewrite, rules, valuesExpressionRewrite
-
Constructor Details
-
PushCastIntoRow
public PushCastIntoRow()
-