Skip to content

Commit

Permalink
Load Data Notebooks modified with comments (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: chetan thote <[email protected]>
  • Loading branch information
chetanthote and chetan thote authored Oct 17, 2024
1 parent c19630c commit aeed378
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
17 changes: 8 additions & 9 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": "a4717276-2860-4b52-95d4-91cb2364735a",
"id": "b447e717-ea59-49fd-8092-36ece56072ae",
"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": "62b43d62-ee7e-479f-8ef7-482253faf7d4",
"id": "0b47d1d0-0308-4b98-8b9a-d9575938995a",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
Expand Down Expand Up @@ -121,8 +121,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create Table\n",
"Creating table for sample data."
"### Create Table"
]
},
{
Expand All @@ -132,7 +131,8 @@
"outputs": [],
"source": [
"%%sql\n",
"CREATE TABLE IF NOT EXISTS `SalesData` (\n",
"\n",
"CREATE TABLE IF NOT EXISTS SalesData /* Creating table for sample data. */ (\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 @@ -149,8 +149,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load Data Using Pipelines\n",
"Creating pipeline for sample data."
"### Load Data Using Pipelines"
]
},
{
Expand All @@ -160,7 +159,7 @@
"outputs": [],
"source": [
"%%sql\n",
"CREATE PIPELINE IF NOT EXISTS SalesData_Pipeline AS\n",
"CREATE PIPELINE IF NOT EXISTS SalesData_Pipeline AS /* Creating pipeline for sample data. */\n",
"LOAD DATA S3 's3://singlestoreloaddata/SalesData/*.csv'\n",
"CONFIG '{ \\\"region\\\": \\\"ap-south-1\\\" }'\n",
"/*\n",
Expand Down Expand Up @@ -364,7 +363,7 @@
},
{
"cell_type": "markdown",
"id": "5b40afb3-f2af-47e1-ac07-1f7eec099c52",
"id": "c5abfdb8-0c85-428f-be0c-82f62516a55a",
"metadata": {},
"source": [
"<div id=\"singlestore-footer\" style=\"background-color: rgba(194, 193, 199, 0.25); height:2px; margin-bottom:10px\"></div>\n",
Expand Down
14 changes: 5 additions & 9 deletions notebooks/load-data-json/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "1b696b96-5d6d-47e1-b178-a387b137064c",
"id": "a5296a57-2be8-41fb-b7e4-3458d7f99324",
"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": "cec96374-2cef-48cd-9c96-15c5e1516fc7",
"id": "777e083a-bd01-454b-a302-2155f7e9b723",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
Expand Down Expand Up @@ -145,9 +145,7 @@
"source": [
"%%sql\n",
"\n",
"# Creating table for sample data\n",
"\n",
"CREATE TABLE IF NOT EXISTS employeeData (\n",
"CREATE TABLE IF NOT EXISTS employeeData /* Creating table for sample data */ (\n",
" userId text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,\n",
" jobTitleName text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,\n",
" firstName text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,\n",
Expand Down Expand Up @@ -175,10 +173,8 @@
"source": [
"%%sql\n",
"\n",
"# Creating pipeline for sample data\n",
"\n",
"CREATE PIPELINE IF NOT EXISTS employeeData AS\n",
"LOAD DATA S3 'singlestoreloaddata/employeedata/*.json'\n",
"LOAD DATA S3 'singlestoreloaddata/employeedata/*.json' /* Creating pipeline for sample data */\n",
"CONFIG '{ \\\"region\\\": \\\"ap-south-1\\\" }'\n",
" /*\n",
" CREDENTIALS '{\"aws_access_key_id\": \"<Key to Enter>\",\n",
Expand Down Expand Up @@ -430,7 +426,7 @@
},
{
"cell_type": "markdown",
"id": "afd2550c-9a8a-44d8-a977-bd8b302b31a7",
"id": "9bd328a2-666d-449e-b327-61d0f114ce88",
"metadata": {},
"source": [
"<div id=\"singlestore-footer\" style=\"background-color: rgba(194, 193, 199, 0.25); height:2px; margin-bottom:10px\"></div>\n",
Expand Down
17 changes: 8 additions & 9 deletions notebooks/load-data-kakfa/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "363343ca-6c2f-4bb5-b83d-c97d87b4191f",
"id": "4fa50251-2837-4228-acb3-3a11d95b8928",
"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": "bc8c4ada-7dee-483f-a39c-9fff00d6e59c",
"id": "2dc3099d-640a-4325-971c-2b20a5ca458d",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
Expand Down Expand Up @@ -111,8 +111,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Create Table\n",
"Creating table for sample data."
"### Create Table"
]
},
{
Expand All @@ -122,7 +121,7 @@
"outputs": [],
"source": [
"%%sql\n",
"CREATE TABLE IF NOT EXISTS `eventsdata` (\n",
"CREATE TABLE IF NOT EXISTS eventsdata /* Creating table for sample data. */ (\n",
" `user_id` varchar(120) DEFAULT NULL,\n",
" `event_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,\n",
" `advertiser` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,\n",
Expand All @@ -140,8 +139,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Load Data using Pipeline\n",
"Creating pipeline for sample data."
"### Load Data using Pipeline"
]
},
{
Expand All @@ -151,7 +149,8 @@
"outputs": [],
"source": [
"%%sql\n",
"CREATE PIPELINE IF NOT EXISTS `eventsdata`\n",
"\n",
"CREATE PIPELINE IF NOT EXISTS eventsdata /* Creating pipeline for sample data. */\n",
"AS LOAD DATA KAFKA 'public-kafka.memcompute.com:9092/ad_events'\n",
"ENABLE OUT_OF_ORDER OPTIMIZATION\n",
"DISABLE OFFSETS METADATA GC\n",
Expand Down Expand Up @@ -346,7 +345,7 @@
},
{
"cell_type": "markdown",
"id": "8e2f46fb-af50-40a3-af8b-8b24707e9630",
"id": "dea172b7-a926-4293-bdbd-ff38eeba581f",
"metadata": {},
"source": [
"<div id=\"singlestore-footer\" style=\"background-color: rgba(194, 193, 199, 0.25); height:2px; margin-bottom:10px\"></div>\n",
Expand Down

0 comments on commit aeed378

Please sign in to comment.