What does map transformation do? Provide an example.
Answer Posted / Manoj Kumar Maurya
Map Transformation is a basic transformation in Apache Spark that applies a user-defined function to each element of the data frame or RDD. Here's an example using a simple map operation: nn`data = sparkSession.createDataFrame([(1, 2), (3, 4), (5, 6)]).toDF("a", "b")ndata.map(lambda row: (row["a"] + row["b"],)).show()`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers