GithubHelp home page GithubHelp logo

Comments (5)

bllchmbrs avatar bllchmbrs commented on July 28, 2024

Not sure what the issue is, since it still works (when they're separate) I'm just going to close this out.

from spark-the-definitive-guide.

ljalbinson avatar ljalbinson commented on July 28, 2024

I appreciate it is not an issue for your book.
However, isn't it a little worrying that the combined case fails? I don't think it should. But I'm happy to be corrected.
And, of course, I'm happy to report it elsewhere if that is more appropriate (assuming it is a bug and not my lack of understanding).
Kind regards, Lawrence

from spark-the-definitive-guide.

bllchmbrs avatar bllchmbrs commented on July 28, 2024

It's probably something to do with the implicits and the REPL compiler, could you try running the first line alone (import ...) and then running the rest as one block?

from spark-the-definitive-guide.

ljalbinson avatar ljalbinson commented on July 28, 2024

Putting the import first doesn't solve the problem; however, it leads to a useful error message, namely:

<console>:18: error: Unable to find encoder for type stored in a Dataset. Primitive types (Int, ....

In this post the case class is moved out of the current scope and the problem is solved, so it seems that it is an implicit resolution issue.

I have tried this with the Ch3 example and it works.

So, in summary, declare the case class as a first snippet and then declare the import, the two vals and the filter/map/take as a second snippet and it is fine.

from spark-the-definitive-guide.

bllchmbrs avatar bllchmbrs commented on July 28, 2024

There we are. Glad we figured it out!

from spark-the-definitive-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.