You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@zeppelin.apache.org by Jeff Zhang <zj...@gmail.com> on 2015/08/10 12:27:25 UTC
Zeppelin editor is not compatible with scala syntax ?
> val orders = sc.textFile("file:///Users/jzhang/Downloads/SampleData.csv")
> .map{line=>line.split(",")}
The above code won't compile successfully, raise error
> orders: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[51] at
textFile at> <console>:39 > <console>:1: error: illegal start of definition
.map{line=>line.split(",")}
I only have to write it as following to make it pass the compilation.
> val orders =
sc.textFile("file:///Users/jzhang/Downloads/SampleData.csv").map{
> line=>line.split(",")}
I am not sure why. Is it intended or difficult to make it compatible with
scala syntax ?
BTW, I am using zeppelin 0.5
--
Best Regards
Jeff Zhang
Re: Zeppelin editor is not compatible with scala syntax ?
Posted by moon soo Lee <mo...@apache.org>.
Hi,
A pull request (https://github.com/apache/incubator-zeppelin/pulls)
created to support such scala syntax.
Thanks,
moon
On Mon, Aug 10, 2015 at 3:27 AM Jeff Zhang <zj...@gmail.com> wrote:
> > val orders =
> sc.textFile("file:///Users/jzhang/Downloads/SampleData.csv")
> > .map{line=>line.split(",")}
>
> The above code won't compile successfully, raise error
> > orders: org.apache.spark.rdd.RDD[String] = MapPartitionsRDD[51] at
> textFile at> <console>:39 > <console>:1: error: illegal start of definition
> .map{line=>line.split(",")}
>
> I only have to write it as following to make it pass the compilation.
>
> > val orders =
> sc.textFile("file:///Users/jzhang/Downloads/SampleData.csv").map{
> > line=>line.split(",")}
>
> I am not sure why. Is it intended or difficult to make it compatible with
> scala syntax ?
>
> BTW, I am using zeppelin 0.5
>
>
> --
> Best Regards
>
> Jeff Zhang
>