Sometimes data has been previously ingested and stored into a database by some other application, so you would need to connect to a database in order to use it for training or testing purposes. This section describes how to get data from a relational database and a NoSQL database. In both cases, Spark would be used.
Training data ingestion from a database with Spark
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...