Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-9832

[Rust] [DataFusion] Refactor PhysicalPlan to remove Partition

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • Rust, Rust - DataFusion
    • None

    Description

      As a step towards supporting an improved threading model, I would like to refactor to remove the redundant `Partition` trait. The implementations of these partition traits really just duplicate the state of their operator and just add the partition number. It would be better to just pass the partition number to the execute() method in the PhysicalPlan trait.

      This means it will also be necessary for each ExecutionPlan to state its output partitioning (and this is needed for other reasons when we get into the physical optimizer).

      Proposed trait:

       

      /// Partition-aware execution plan for a relation
      pub trait ExecutionPlan: Debug {
          /// Get the schema for this execution plan
          fn schema(&self) -> SchemaRef;
          /// Specifies the output partitioning of this execution plan
          fn output_partitioning(&self) -> Partitioning;
          /// Execute this plan for a single partition and return a stream of results
          fn execute(&self, partition: usize) -> Result<Arc<Mutex<dyn RecordBatchReader + Send + Sync>>>;
      }
      
      /// Partitioning schemes supported by operators.
      #[derive(Debug, Clone)]
      pub enum Partitioning {
          UnknownPartitioning(usize),
      }
       

      Attachments

        Activity

          People

            andygrove Andy Grove
            andygrove Andy Grove
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: