Loading from RDBMS

As the final recipe on loading, let's try to load data from an RDBMS data source, which is MySQL in our case. This recipe assumes that you have already installed MySQL in your machine.

How to do it…

Let's go through the prerequisite steps first. If you already have a MySQL table to play with, you can safely ignore this step. We are just going to create a new database and a table and load some sample data into it.

The prerequisite step (optional):

  1. Creating a database and a table: This is achieved in MySQL by using the create database and the create table DDL:
    create database scalada;
    use scalada
    CREATE TABLE student (
    id varchar(20),
    `name` varchar(200),
    phone varchar(50),
    email varchar(200),
    PRIMARY KEY (id));
  2. Loading data into the ...

Get Scala: Guide for Data Science Professionals now with O’Reilly online learning.

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