What are the exact differences between reduce and fold operation in Spark?



What are the exact differences between reduce and fold operation in Spark?..

Answer / Trapti Kansal

reduce: It is a transformational action in Spark that reduces an RDD to a single value by applying an associative and commutative binary function. The default function is concatenation for strings, addition for numbers, etc.nfold: It is a more generalized version of reduce. Instead of reducing to a single value, fold can accumulate the result into a user-defined datatype (not just a single value).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache Spark Interview Questions

Do you need to install spark on all nodes of yarn cluster?

1 Answers  


Are spark dataframes immutable?

1 Answers  


Is Apache Spark a good fit for Reinforcement learning?

1 Answers  


What is the command to start and stop the Spark in an interactive shell?

1 Answers  


How do sparks work?

1 Answers  


Explain the various Transformation on Apache Spark RDD like distinct(), union(), intersection(), and subtract()?

1 Answers  


What is the method to create a data frame?

1 Answers  


Who uses apache spark?

1 Answers  


Where is apache spark used?

1 Answers  


What are the actions in spark?

1 Answers  


What apache spark is used for?

1 Answers  


Describe Spark SQL?

1 Answers  


Categories