spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Laskowski <>
Subject error: reference to sql is ambiguous after import org.apache.spark._ in shell?
Date Tue, 05 Apr 2016 00:16:39 GMT
Hi Spark devs,

I'm unsure if what I'm seeing is correct. I'd appreciate any input 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

Jacek Laskowski
Mastering Apache Spark
Follow me at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message