spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: error: reference to sql is ambiguous after import org.apache.spark._ in shell?
Date Tue, 05 Apr 2016 00:20:04 GMT
Looks like the import comes from
repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkILoop.scala :

      processLine("import sqlContext.sql")

On Mon, Apr 4, 2016 at 5:16 PM, Jacek Laskowski <jacek@japila.pl> wrote:

> Hi Spark devs,
>
> I'm unsure if what I'm seeing is correct. I'd appreciate any input
> to...rest my nerves :-) I did `import org.apache.spark._` by mistake,
> but since it's valid, I'm wondering why does Spark shell imports sql
> at all since it's available after the import?!
>
> (it's today's build)
>
> scala> sql("SELECT * FROM dafa").show(false)
> <console>:30: error: reference to sql is ambiguous;
> it is imported twice in the same scope by
> import org.apache.spark._
> and import sqlContext.sql
>        sql("SELECT * FROM dafa").show(false)
>        ^
>
> scala> :imports
>  1) import sqlContext.implicits._  (52 terms, 31 are implicit)
>  2) import sqlContext.sql          (1 terms)
>
> scala> sc.version
> res19: String = 2.0.0-SNAPSHOT
>
> Pozdrawiam,
> Jacek Laskowski
> ----
> https://medium.com/@jaceklaskowski/
> Mastering Apache Spark http://bit.ly/mastering-apache-spark
> Follow me at https://twitter.com/jaceklaskowski
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
> For additional commands, e-mail: dev-help@spark.apache.org
>
>

Mime
View raw message