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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.