Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fold operation #45

Closed
idubinskiy opened this issue May 27, 2016 · 3 comments
Closed

Fold operation #45

idubinskiy opened this issue May 27, 2016 · 3 comments

Comments

@idubinskiy
Copy link

Is there any way to implement a fold operation with the current dataset methods? If not, is there a plan to add it? I'd be willing to give it a shot.

@chrislusf
Copy link
Owner

You are welcome to hack this!

Do you have any specific needs for this? I was thinking just use Go's default value in reduce operation, to avoid the need for fold.

Fold can not be parallelized.

http://stackoverflow.com/questions/25158780/difference-between-reduce-and-foldleft-fold-in-functional-programming-particula

@idubinskiy
Copy link
Author

just use Go's default value in reduce operation

Not sure what you mean by that.

As far as specific need, I'm trying to re-implement an algorithm using Glow, and ran into a bit of a roadblock. But I think I may be able to work around it by doing Map(type A -> type B).Reduce(typeB, type B -> type B), or maybe ReduceByKey.

@chrislusf
Copy link
Owner

I see. That'll work.

And let me know if glow works for you or not.

I would prefer not to implment fold, which can not be done efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants