Class RemoveRedundantTableFunction
java.lang.Object
io.trino.sql.planner.iterative.rule.RemoveRedundantTableFunction
- All Implemented Interfaces:
Rule<TableFunctionProcessorNode>
public class RemoveRedundantTableFunction
extends Object
implements Rule<TableFunctionProcessorNode>
Table function can take multiple table arguments. Each argument is either "prune when empty" or "keep when empty".
"Prune when empty" means that if this argument has no rows, the function result is empty, so the function can be
removed from the plan, and replaced with empty values.
"Keep when empty" means that even if the argument has no rows, the function should still be executed, and it can
return a non-empty result.
All the table arguments are combined into a single source of a TableFunctionProcessorNode. If either argument is
"prune when empty", the overall result is "prune when empty". This rule removes a redundant TableFunctionProcessorNode
based on the "prune when empty" property.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(TableFunctionProcessorNode node, Captures captures, Rule.Context context) Returns a pattern to which plan nodes this rule applies.
-
Constructor Details
-
RemoveRedundantTableFunction
public RemoveRedundantTableFunction()
-
-
Method Details
-
getPattern
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<TableFunctionProcessorNode>
-
apply
- Specified by:
applyin interfaceRule<TableFunctionProcessorNode>
-