Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • thanks for the answer but appears a new error, check the edit Commented Oct 1, 2017 at 15:55
  • I think you should give encoder outside the map over groupedNpa. implicit val encoder = RowEncoder(schema) Give schema of your dataframe. Commented Oct 1, 2017 at 16:06
  • same result, how should I pass the map? Commented Oct 1, 2017 at 18:12
  • if you could show groupedNpa. I can give try on my shell. Commented Oct 2, 2017 at 4:09
  • It's a toy example. The real one I have is far more complex. But, could you add a line in your answer showing how you would invoke the custom function using the encoder? Commented Oct 2, 2017 at 10:03