From the course: Advanced NoSQL for Data Science
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Load data into Cassandra - NoSQL Tutorial
From the course: Advanced NoSQL for Data Science
Load data into Cassandra
- [Instructor] We're starting off where we left off in the last video. What I'd now like to do is load some data using json. So, the first thing I'm going to do is import a json library. Now, I'm going to use the with open command to open my json file, which is called companies.json, and I'm going to refer to that file as f_in for file input, and I'm going to use the json load command to read that file in. Now, I want to save the contents of the file into a variable, so I'm going to use the variable companies. Now, let's double check on the type of companies. It's a list, that's what I expected. So let's take a look at the first element in that list. Okay, it's got information about a company, as we'd expect. Now, that certainly looks like a dictionary, but just to make sure, I'm going to execute the type command on the first element and the companies list. Yup, it's a dictionary. Now, the next thing I want to do is execute a very simple insert statement to insert one company record…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Wide-column data models2m 56s
-
(Locked)
Prepare data with wide-column databases2m 19s
-
(Locked)
Install the Java Development Kit1m 4s
-
(Locked)
Install Cassandra1m 49s
-
(Locked)
Prepare data for Cassandra6m 26s
-
(Locked)
Load data into Cassandra4m 30s
-
(Locked)
Cassandra and Spark1m 29s
-
(Locked)
Tips for using wide-column databases for data science2m 14s
-
(Locked)
-
-