concept Java in category spark

appears as: Java, Java
Spark in Action, Second Edition

This is an excerpt from Manning's book Spark in Action, Second Edition.

The scenario you will follow involves distributed loading of a CSV file, performing a small operation, and saving the result in a PostgreSQL database (and Apache Derby). Knowing or installing PostgreSQL is not required to understand the example. If you are familiar with using other RDBMSs and Java, you will easily adapt to this example. Appendix F provides additional help with relational databases (tips, installation, links, and more).

Java 8 introduced lambda functions, which can exist without belonging to a class and can be passed around as parameters, and are executed on demand. You will discover how lambda functions can help you (or not) to write transformation code.

Figure 5.5 Computing π by using lambda functions in Java: the code is more compact, but the process is the same as the class-based process in figure 5.3.
{
    "shipmentId": 458922, #1
    "date": "2019-10-05", #1
    "supplier": { #2
      "name": "Manning Publications",
      "city": "Shelter Island",
      "state": "New York",
      "country": "USA"
    },
    "customer": { #2
      "name": "Jean-Georges Perrin",
      "city": "Chapel Hill",
      "state": "North Carolina",
      "country": "USA"
    },
    "books": [ #3
      {
        "title": "Spark with Java",
        "qty": 2
      },
      {
        "title": "Spark in Action, 2nd Edition",
        "qty": 25
      },
      {
        "title": "Spark in Action, 1st Edition",
        "qty": 1
      }
    ]
 }