Re: flatMap issue

2016-04-28 Thread Punit Naik
Yes you have. Thanks a lot Stefano Sir! On Thu, Apr 28, 2016 at 6:40 PM, Stefano Baghino < stefano.bagh...@radicalbit.io> wrote: > The behavior you described actually makes sense: by passing the identity > function (x => x) to flatMap, you're basically just flattening your data > set, and since i

Re: flatMap issue

2016-04-28 Thread Stefano Baghino
The behavior you described actually makes sense: by passing the identity function (x => x) to flatMap, you're basically just flattening your data set, and since in Scala strings are also a collection of characters, you are presented with a collection of characters. If you just one to do something o

Re: flatMap issue

2016-04-28 Thread Punit Naik
No Sir, its one json per line. On Thu, Apr 28, 2016 at 3:19 PM, Fabian Hueske wrote: > readTextFile reads a file line-wise. > > Is it possible, that your first line only contains "{"? > > 2016-04-28 8:06 GMT+02:00 Punit Naik : > > > I have a test file which has a json per line. When I do a flatM

Re: flatMap issue

2016-04-28 Thread Fabian Hueske
readTextFile reads a file line-wise. Is it possible, that your first line only contains "{"? 2016-04-28 8:06 GMT+02:00 Punit Naik : > I have a test file which has a json per line. When I do a flatMap on it, it > automatically splits the whole json line on every character. Why does this > happen?