Class ApplyPreferredTableWriterPartitioning
- java.lang.Object
-
- io.trino.sql.planner.iterative.rule.ApplyPreferredTableWriterPartitioning
-
- All Implemented Interfaces:
Rule<TableWriterNode>
public class ApplyPreferredTableWriterPartitioning extends Object implements Rule<TableWriterNode>
Rule verifies if preconditions for using preferred write partitioning are met: - expected number of partitions to be written (based on table stat) is greater than or equal to preferred_write_partitioning_min_number_of_partitions session property, - use_preferred_write_partitioning is set to true. If precondition are met theTableWriterNodeis modified to mark the intention to use preferred write partitioning: value ofTableWriterNode.getPreferredPartitioningScheme()is set as result ofTableWriterNode.getPartitioningScheme().
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.trino.sql.planner.iterative.Rule
Rule.Context, Rule.Result
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern<TableWriterNode>WRITER_NODE_WITH_PREFERRED_PARTITIONING
-
Constructor Summary
Constructors Constructor Description ApplyPreferredTableWriterPartitioning()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule.Resultapply(TableWriterNode node, Captures captures, Rule.Context context)Pattern<TableWriterNode>getPattern()Returns a pattern to which plan nodes this rule applies.booleanisEnabled(Session session)
-
-
-
Field Detail
-
WRITER_NODE_WITH_PREFERRED_PARTITIONING
public static final Pattern<TableWriterNode> WRITER_NODE_WITH_PREFERRED_PARTITIONING
-
-
Method Detail
-
getPattern
public Pattern<TableWriterNode> getPattern()
Description copied from interface:RuleReturns a pattern to which plan nodes this rule applies.- Specified by:
getPatternin interfaceRule<TableWriterNode>
-
isEnabled
public boolean isEnabled(Session session)
- Specified by:
isEnabledin interfaceRule<TableWriterNode>
-
apply
public Rule.Result apply(TableWriterNode node, Captures captures, Rule.Context context)
- Specified by:
applyin interfaceRule<TableWriterNode>
-
-