Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12245

Memoize DataFrame operations

Details

    Description

      Currently performing an operation on a deferred dataframe always produces a new deferred dataframe. This means a call like to_pcollection(df.mean(), df.mean()), will produce two distinct PCollections duplicating the same computation.

      This is particularly problematic for the interactive use-case where, to_pcollection is used inside of ib.collect() in combination with PCollection caching. Collecting df.mean() two different times will duplicate the computation unnecessarily.

      We should cache the output expressions produced by operations to prevent this.

      We need to be mindful of inplace operations when implementing this:

      • Two calls to df.mean() should produce the same result iff df has not been mutated in between.
      • If the output of one call to df.mean() is mutated, it must not mutate the output of another call to df.mean().

      Attachments

        Activity

          People

            Unassigned Unassigned
            bhulette Brian Hulette
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: