deanwampler / spark-scala-tutorial

A free tutorial for Apache Spark.
Other
980 stars 431 forks source link

Type inference doesn't work with IDE #20

Closed JohnReedLOL closed 8 years ago

JohnReedLOL commented 8 years ago

Normally when I clone an sbt project from GitHub into IntelliJ, type inference works.

I did File > New > Project from Version Control > GitHub, cloned it, and type inference does not work.

deanwampler commented 8 years ago

I don't know what you mean by "type inference doesn't work". Does the cloned project compile without error? If there are errors, perhaps the dependencies didn't get brought over successfully.

JohnReedLOL commented 8 years ago

Pressing "Ctrl-Q" in IntelliJ is supposed to bring up the type but it doesn't. The project compiles and runs with sbt.

deanwampler commented 8 years ago

I don't really know why that happens. What file?

JohnReedLOL commented 8 years ago

Watch this video...

https://youtu.be/PWBVe-ISiJ8

Basically normally when you clone a repo into IntelliJ, type inference works. Ctr-Q pulls up the type. Hover over pulls up the type.

What happened was when I imported spark-scala-tutorial into IntelliJ and followed the exact same steps as I did for hello-slick, type inference did not work in any text file. For example, val sc of type "SparkContext" was being type inferred to "Any".

Unfortunately, when I got around to replicating it, everything worked.