concept datum in category spark

appears as: data, data, The data
Spark in Action, Second Edition

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

In this chapter, you will build a mental model of Apache Spark. A mental model is an explanation of how something works in the real world, using your thought process and following diagrams. The goal of this chapter is to help you define your own ideas about the thought process I will walk you through. I will use a lot of diagrams and some code. It would be extremely pretentious to build a unique Spark mental model; this model will describe a typical scenario involving loading, processing, and saving data. You will also walk through the Java code for these operations.

Appendix Q. Reference for exporting data

You can use this appendix as a reference for all-things-export: main formats, options for Parquet, CSV, JSON, and more. Because you will need to export data in Spark, this appendix will be very useful. It has some similarities with appendix L (for ingestion). The content is aggregated from several web pages, providing an easy one-stop shop for all developers.

The general syntax for exporting data is illustrated in figure Q.1.

Figure Q.1 General syntax for exporting data from a dataframe, with format, option, and mode
Listing Q.1 Excerpt of exporting data using JDBC using options
df .write()
            .mode(SaveMode.Overwrite)
            .option( "dbtable" , "ch02lab900" )
            .option( "url" , "jdbc:postgresql://localhost/spark_labs" )
            .option( "driver" , "org.postgresql.Driver" )
            .option( "user" , "jgp" )
            .option( "password" , "Spark<3Java" )
            .format( "jdbc" )
             .save();