Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

summingbird does not preserve equality on Producers #746

Open
johnynek opened this issue Sep 8, 2017 · 0 comments
Open

summingbird does not preserve equality on Producers #746

johnynek opened this issue Sep 8, 2017 · 0 comments

Comments

@johnynek
Copy link
Collaborator

johnynek commented Sep 8, 2017

due to the use of anonymous functions inside producer, if you have (p1, f1) == (p2, f2) you don't get p1.map(f1) == p2.map(f2). This frustrates the ability to memoize caching, which can in the worst case cause recomputation.

We are running a lot of issues like these down, but the solution we have come up with is to never use anonymous functions inside the planners and instead always use thinks like:

case class GetValue[K, V]() extends Function1[(K, V), V] {
  def apply(kv: (K, V)) = kv._2
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant