Skip to content

Commit

Permalink
Modified with suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan thote authored and chetan thote committed Jul 11, 2024
1 parent 8cf1641 commit 51cd5d0
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 110 deletions.
4 changes: 4 additions & 0 deletions authors/chetan-thote.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name="Chetan Thote"
title="Product Team"
image="singlestore"
external=false
2 changes: 1 addition & 1 deletion notebooks/load-csv-data-s3/meta.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[meta]
authors=["singlestore"]
authors=["chetan-thote"]
title="Sales Data Analysis Dataset From Amazon S3"
description="""\
The Sales Data Analysis use case demonstrates how to utilize Singlestore's powerful querying capabilities to analyze sales data stored in a CSV file."""
Expand Down
84 changes: 35 additions & 49 deletions notebooks/load-csv-data-s3/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,32 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2d22fd53-2c18-40e5-bb38-6d8ebc06f1b8",
"id": "46fb95a8-1402-4b97-b04a-560741f96181",
"metadata": {},
"source": [
"## Create a database\n",
"\n",
"We need to create a database to work with in the following examples."
"## How to use this notebook"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "b5beab5e-ddc2-4cb3-9708-e84c1bc5e95e",
"id": "a701cd90-dd42-4a06-b7a1-e0a2132af558",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b class=\"fa fa-solid fa-exclamation-circle\"></b>\n",
" <div>\n",
" <p><b>Action Required</b></p>\n",
" <p> If you have a Free Starter Workspace deployed already, select the database from drop-down menu at the top of this notebook. It updates the <tt>connection_url</tt> to connect to that database.</p>\n",
" </div>\n",
"</div>"
"<img src=https://singlestoreloaddata.s3.ap-south-1.amazonaws.com/images/notebookuse.gif width=\"75%\" hight=\"50%\"/>"
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "2d22fd53-2c18-40e5-bb38-6d8ebc06f1b8",
"metadata": {},
"source": [
"## Create a database\n",
"\n",
"We need to create a database to work with in the following examples."
]
},
{
Expand All @@ -88,11 +93,10 @@
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS LoadData;\n",
" %sql CREATE DATABASE LoadData;"
" %sql DROP DATABASE IF EXISTS SalesAnalysis;\n",
" %sql CREATE DATABASE SalesAnalysis;"
]
},
{
Expand Down Expand Up @@ -130,7 +134,7 @@
"id": "1de959eb-4f17-45d4-af74-42f45684d67b",
"metadata": {},
"source": [
"<h3>Load Data</h3>"
"<h3>Load Data Using Pipelines</h3>"
]
},
{
Expand All @@ -151,34 +155,15 @@
"INTO TABLE SalesData\n",
"FIELDS TERMINATED BY ','\n",
"LINES TERMINATED BY '\\r\\n'\n",
"IGNORE 1 lines;"
"IGNORE 1 lines;\n",
"\n",
"\n",
"START PIPELINE SalesData_Pipeline;"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "12780179-5aa6-4593-8b83-fadef73e7373",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"START PIPELINE SalesData_Pipeline"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "e291daed-75bc-4d13-b2cb-4684bbb36c4a",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"SELECT COUNT(*) FROM SalesData"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "352e340a-a613-4ec5-94a5-c4e1f3565757",
"metadata": {},
"outputs": [],
Expand All @@ -193,7 +178,7 @@
"id": "4508d431-7683-4ac9-a4e8-d939c47dd1fc",
"metadata": {},
"source": [
"<h3>Queries</h3>\n",
"<h3>Sample Queries</h3>\n",
"\n",
"We will try to execute some Analytical Queries"
]
Expand All @@ -209,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"id": "d666c04b-ccb0-47cc-a1e7-efaa7a590d27",
"metadata": {},
"outputs": [],
Expand All @@ -230,7 +215,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"id": "b46d72c7-07a3-4e23-8fe4-c238b5517ef6",
"metadata": {},
"outputs": [],
Expand All @@ -251,7 +236,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"id": "af571f6c-0145-4466-9ed7-000d37e4738f",
"metadata": {},
"outputs": [],
Expand All @@ -272,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"id": "5613b3e8-72d2-48dc-a7ae-47911df24cd2",
"metadata": {},
"outputs": [],
Expand All @@ -293,7 +278,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"id": "7fd8d785-7861-4570-88b3-0185c2c9c298",
"metadata": {},
"outputs": [],
Expand All @@ -304,6 +289,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "83b2d1e6-58b8-493e-a698-2fd46e2ac5a1",
"metadata": {},
Expand All @@ -312,6 +298,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "6738b6e4-5e8b-45db-b3dc-ebcb73bcf629",
"metadata": {},
Expand All @@ -332,15 +319,14 @@
},
{
"cell_type": "code",
"execution_count": 12,
"id": "8b2e5f61-0336-496b-88c3-e7e02b2575d8",
"execution_count": 10,
"id": "d5053a52-5579-4fea-9594-5250f6fcc289",
"metadata": {},
"outputs": [],
"source": [
"%%sql\n",
"shared_tier_check = %sql show variables like 'is_shared_tier'\n",
"if not shared_tier_check or shared_tier_check[0][1] == 'OFF':\n",
" %sql DROP DATABASE IF EXISTS LoadData;"
" %sql DROP DATABASE IF EXISTS SalesAnalysis;"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/load-data-kakfa/meta.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[meta]
authors=["singlestore"]
authors=["chetan-thote"]
title="Real-Time Event Monitoring Dataset From Kafka"
description="""\
The Real-Time Event Monitoring use case illustrates how to leverage Singlestore's capabilities to process and analyze streaming data from a Kafka data source.
Expand Down
Loading

0 comments on commit 51cd5d0

Please sign in to comment.