Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Data Notebooks modified with comments #118

Merged
merged 8 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 11 additions & 40 deletions notebooks/load-csv-data-s3/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "",
"id": "a4717276-2860-4b52-95d4-91cb2364735a",
"metadata": {},
"source": [
"<div id=\"singlestore-header\" style=\"display: flex; background-color: rgba(235, 249, 245, 0.25); padding: 5px;\">\n",
Expand All @@ -18,7 +18,7 @@
},
{
"cell_type": "markdown",
"id": "",
"id": "62b43d62-ee7e-479f-8ef7-482253faf7d4",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
Expand All @@ -33,7 +33,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
Expand All @@ -48,7 +47,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"The Sales Data Analysis use case demonstrates how to leverage SingleStore's powerful querying capabilities in a business intelligence context like analyzing sales data stored in a CSV file.\n",
Expand All @@ -67,7 +65,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<h3>Demo Flow</h3>"
Expand All @@ -76,7 +73,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<img src=https://singlestoreloaddata.s3.ap-south-1.amazonaws.com/images/LoadDataCSV.png width=\"100%\" hight=\"50%\"/>"
Expand All @@ -85,7 +81,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"## How to use this notebook"
Expand All @@ -94,7 +89,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<img src=https://singlestoreloaddata.s3.ap-south-1.amazonaws.com/images/notebookuse.gif width=\"75%\" hight=\"50%\"/>"
Expand All @@ -103,7 +97,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"## Create a database (You can skip this Step if you are using Free Starter Tier)\n",
Expand All @@ -114,7 +107,6 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -127,21 +119,20 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<h3>Create Table</h3>"
"### Create Table\n",
"Creating table for sample data."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"CREATE TABLE `SalesData` (\n",
"CREATE TABLE IF NOT EXISTS `SalesData` (\n",
" `Date` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,\n",
" `Store_ID` bigint(20) DEFAULT NULL,\n",
" `ProductID` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,\n",
Expand All @@ -156,21 +147,20 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<h3>Load Data Using Pipelines</h3>"
"### Load Data Using Pipelines\n",
"Creating pipeline for sample data."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"CREATE PIPELINE SalesData_Pipeline AS\n",
"CREATE PIPELINE IF NOT EXISTS SalesData_Pipeline AS\n",
"LOAD DATA S3 's3://singlestoreloaddata/SalesData/*.csv'\n",
"CONFIG '{ \\\"region\\\": \\\"ap-south-1\\\" }'\n",
"/*\n",
Expand All @@ -189,7 +179,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"### Data may take couple of seconds to load after pipeline is started, rerun cell to verify"
Expand All @@ -198,7 +187,6 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -209,7 +197,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<h3>Sample Queries</h3>\n",
Expand All @@ -220,7 +207,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<b>Top-Selling Products"
Expand All @@ -229,7 +215,6 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -241,7 +226,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<b>Sales Trends Over Time"
Expand All @@ -250,7 +234,6 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -262,7 +245,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<b>Total Sales by Store"
Expand All @@ -271,7 +253,6 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -283,16 +264,14 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<b>Sales Contribution by Product (Percentage)"
"<b>Sales Contribution by Product (Percentage)</b>"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -304,7 +283,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"<b>Top Days with Highest Sale</b>"
Expand All @@ -313,7 +291,6 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -325,7 +302,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"## Conclusion\n",
Expand All @@ -337,7 +313,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"## Clean up\n",
Expand All @@ -348,7 +323,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"#### Drop Pipeline"
Expand All @@ -357,12 +331,11 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"%%sql\n",
"\n",
"#STOP PIPELINE SalesData_Pipeline;\n",
"\n",
"#DROP PIPELINE SalesData_Pipeline;"
Expand All @@ -371,7 +344,6 @@
{
"attachments": {},
"cell_type": "markdown",
"id": "",
"metadata": {},
"source": [
"#### Drop Data"
Expand All @@ -380,7 +352,6 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -393,7 +364,7 @@
},
{
"cell_type": "markdown",
"id": "",
"id": "5b40afb3-f2af-47e1-ac07-1f7eec099c52",
"metadata": {},
"source": [
"<div id=\"singlestore-footer\" style=\"background-color: rgba(194, 193, 199, 0.25); height:2px; margin-bottom:10px\"></div>\n",
Expand Down
Loading
Loading