Data ingestion from a relational database

Suppose the data is stored in a table called sparkexample in a MySQL (https://dev.mysql.com/) schema with the name sparkdb. This is the structure of that table:

mysql> DESCRIBE sparkexample;+-----------------------+-------------+------+-----+---------+-------+| Field                 | Type        | Null | Key | Default | Extra |+-----------------------+-------------+------+-----+---------+-------+| DateTimeString        | varchar(23) | YES  |     | NULL    |       || CustomerID            | varchar(10) | YES  |     | NULL    |       || MerchantID            | varchar(10) | YES  |     | NULL    |       || NumItemsInTransaction | int(11)     | YES  |     | NULL    |       || MerchantCountryCode   | varchar(3)  | YES  |     | NULL    |       || TransactionAmountUSD  | float       | YES  |     | NULL    |       || FraudLabel | varchar(5) | YES | | ...

Get Hands-On Deep Learning with Apache Spark now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.