diff --git a/README.md b/README.md index d4e6d9b..433ffc2 100644 --- a/README.md +++ b/README.md @@ -11,59 +11,99 @@ The following will walk you through the steps for setting up [Apache Zeppelin](https://zeppelin.apache.org/) to integrate with MariaDB and work with several samples of modern SQL functionality. # Table of Contents -1. [Environment and Compatibility](#compatibility) -2. [Getting started with MariaDB](#overview) - 1. [The Basics](#intro-mariadb) - 2. [Downloading and installing MariaDB](#installation) -3. [Requirements](#requirements) -4. [Getting started with Apache Zeppelin](#getting-started) -5. [Support and Contribution](#support-contribution) -6. [License](#license) +1. [Requirements](#requirements) +2. [Introduction to MariaDB](#introduction) + 1. [MariaDB Platform](#platform) + 2. [MariaDB SkySQL](#skysql) +3. [Preparing the database](#prepare) + 1. [Create the schema](#schema) + 2. [Load the data](#data) +4. [Using Apache Zeppelin](#getting-started) + 1. [Adding a MariaDB Interpreter](#add-interpreter) + 2. [Importing Zeppelin notes](#import-note) +5. [Raw Queries](#queries) +6. [Support and Contribution](#support-contribution) +7. [License](#license) -## Environment and Compatibility - -This sample was created using the following techologies: - -* [MariaDB](https://mariadb.com/products/mariadb-platform/) -* [Apache Zeppelin](https://zeppelin.apache.org/) - -This application was tested on [macOS Mojave v.10.14.6](https://developer.apple.com/documentation/macos_release_notes/macos_mojave_10_14_6_release_notes). - -## Overview - -### Introduction to MariaDB - -[MariaDB platform](https://mariadb.com/products/mariadb-platform/) unifies [MariaDB TX (transactions)](https://mariadb.com/products/mariadb-platform-transactional/) and [MariaDB AX (analytics)](https://mariadb.com/products/mariadb-platform-analytical/) so transactional applications can retain unlimited historical data and leverage powerful, real-time analytics in order to provide data-driven customers with more information, actionable insight and greater value – and businesses with endless ways to monetize data. It is the enterprise open source database for hybrid transactional/analytical processing at scale. - -### Getting start with MariaDB - -To download and deploy MariaDB check out the instructions [here](https://mariadb.com/docs/deploy/installation/). You can also make use of the [MariaDB Image available on Docker Hub](https://hub.docker.com/_/mariadb). - -### Create the schema - -Next execute the SQL within [create_schema_data.sql](create_schema_data.sql) within a new database. The script will create the following tables - -* supers -* teams -* supersteams - -and insert a small amount of sample data into them. From there you can add/remove your own data! - -## Requirements +## Environment and Compatibility This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies. -* Download and install [MariaDB](#installation). +* Download and install [MariaDB](#introduction). * Download and install [Apache Zeppelin](https://zeppelin.apache.org/download.html). * git (Optional) - this is required if you would prefer to pull the source code from GitHub repo. - Create a [free github account](https://github.com/) if you don’t already have one - git can be downloaded from git-scm.org +## Introduction to MariaDB + +### MariaDB Platform + +[MariaDB Platform](https://mariadb.com/products/mariadb-platform/) integrates [transactional](https://mariadb.com/products/mariadb-platform-transactional/) and [analytical](https://mariadb.com/products/mariadb-platform-analytical/) products so developers can build modern applications by enriching transactions with real-time analytics and historical data, creating insightful experiences and compelling opportunities for customers – and for businesses, endless ways to monetize data. + +

+ + + +

+ +To get started using MariaDB locally you can choose one of the following options: + +* [Download and install MariaDB (Community or Enterprise) directly from mariadb.com](https://mariadb.com/docs/deploy/installation/) + +* [Download and install MariaDB using the official MariaDB Community Server 10.5 Docker Image available at hub.docker.com](https://hub.docker.com/r/mariadb/columnstore) + +### MariaDB SkySQL + +[SkySQL](https://mariadb.com/products/skysql/) is the first and only database-as-a-service (DBaaS) to bring the full power of MariaDB Platform to the cloud, including its support for transactional, analytical and hybrid workloads. Built on Kubernetes, and optimized for cloud infrastructure and services, SkySQL combines ease of use and self-service with enterprise reliability and world-class support – everything needed to safely run mission-critical databases in the cloud, and with enterprise governance. + +[Get started with SkySQL!](https://mariadb.com/products/skysql/#get-started) + +

+ + + +

+ +## Preparing the database
+ +### Create the schema + +Next execute the SQL within [schema.sql](sql/schema.sql) either manually within a new database, or using the MariaDB client: + +Locally (with root and empty password): +```bash +$ mariadb < sql/schema.sql +``` + +MariaDB SkySQL: +```bash +mariadb --host tx-1.mdb0001390.db.skysql.net --port 5002 --user DB00003108 -pPassword123! --ssl-ca ~/Downloads/skysql_chain.pem < sql/schema.sql> +``` + +**Note:** The previous commands assume you have the MariaDB client installed, the relative locations of [schema.sql](sql/schema.sql) and the skysql_chain.pem file residing in a directory called `Downloads`. But all things are configurable :) + +The script will create the following tables within a database called `demo`: + +* `supers` +* `teams` +* `supersteams` + +### Load the data + +Once the database and tables have been created, execute the [data.sql](sql/data.sql) script to load data into the tables. + +```bash +$ mariadb < sql/data.sql +``` + ## Getting started with Apache Zeppelin -### Adding a MariaDB interpreter +### Adding a MariaDB interpreter

-### Importing the notebooks +### Importing notes
-Import the notes: +In Zeppelin, a notebook is simply a collection of notes, which is a collection of “paragraphs”. Each paragraph then uses an interpreter (via MariaDB Connector/J) to connect to and communicate with a datasource (MariaDB). -* [demo_1.json](demo_1.json): Set operators, table value constructors, aggregation functions, and rollups. -* [demo_2.json](demo_2.json): Window functions and common table expressions (recursive). -* [demo_3.json](demo_3.json): Temporal tables. +

+ + + +

+ +This repo contains several notes that demonstrate a variety of modern SQL capabilities within MariaDB. + +* [demo_1](zeppelin/demo_1.json), [demo_4](zeppelin/demo_4.json): Set operators, table value constructors, aggregation functions, and rollups. +* [demo_2](zeppelin/demo_2.json), [demo_5](zeppelin/demo_5.json): Window functions and common table expressions (recursive). +* [demo_3](zeppelin/demo_3.json), [demo_6](zeppelin/demo_6.json): Temporal tables. * [bitemporal-table-demo](bitemporal-table-demo.json): A comprehensive look at a MariaDB Bitemporal table. -by selecting "Import note". +Notes can be imported into Zeppelin by clicking the "Import Note" button, and providing a valid `json` note file.

@@ -116,6 +164,9 @@ by selecting "Import note".

+## Raw Queires + +If you'd prefer to execute the SQL queries contained within the Apache Zeppelin you can find them all within [demos.sql](sql/demos.sql). ## Support and Contribution diff --git a/create_schema_data.sql b/create_schema_data.sql deleted file mode 100644 index 711814c..0000000 --- a/create_schema_data.sql +++ /dev/null @@ -1,73 +0,0 @@ -DROP TABLE IF EXISTS `supers`; - -CREATE TABLE `supers` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL DEFAULT '', - `alias` varchar(50) NOT NULL DEFAULT '', - `type` char(1) NOT NULL DEFAULT '', - `rescues` int(11) NOT NULL, - `mentor` int(11) DEFAULT NULL, - `startDate` datetime NOT NULL, - `endDate` datetime NOT NULL, - PRIMARY KEY (`id`), - PERIOD FOR `date_period` (`startDate`, `endDate`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -LOCK TABLES `supers` WRITE; - -INSERT INTO `supers` (`id`, `name`, `alias`, `type`, `rescues`, `mentor`, `startDate`, `endDate`) -VALUES - (1,'Bruce Wayne','Batman','H',192,6,'2016-01-01 00:00:00','2020-01-01 00:00:00'), - (2,'Clark Kent','Superman','H',257,NULL,'2016-01-01 00:00:00','2020-01-01 00:00:00'), - (3,'Diana Prince','Wonder Woman','H',212,NULL,'2016-01-01 00:00:00','2020-01-01 00:00:00'), - (4,'Dick Grayson','Robin/Nightwing','H',127,1,'2016-01-01 00:00:00','2020-01-01 00:00:00'), - (5,'Beast Boy','Gar Logan','H',59,NULL,'2016-01-01 00:00:00','2020-01-01 00:00:00'), - (6,'Ra\'s Ah Ghul','The Demon\'s Head','V',3,NULL,'2016-06-01 00:00:00','2020-01-01 00:00:00'), - (7,'Frank Castle','The Punisher','V',37,NULL,'2016-01-01 00:00:00','2020-01-01 00:00:00'); - -UNLOCK TABLES; - - -# Dump of table supersteams -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `supersteams`; - -CREATE TABLE `supersteams` ( - `supersid` int(11) unsigned NOT NULL, - `teamsid` int(11) unsigned NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -LOCK TABLES `supersteams` WRITE; - -INSERT INTO `supersteams` (`supersid`, `teamsid`) -VALUES - (1,1), - (2,1), - (3,1), - (4,1), - (4,2), - (5,2); - -UNLOCK TABLES; - - -# Dump of table teams -# ------------------------------------------------------------ - -DROP TABLE IF EXISTS `teams`; - -CREATE TABLE `teams` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -LOCK TABLES `teams` WRITE; - -INSERT INTO `teams` (`id`, `name`) -VALUES - (1,'Justice League'), - (2,'Teen Titans'); - -UNLOCK TABLES; diff --git a/demo_1.json b/demo_1.json deleted file mode 100644 index cb92ae4..0000000 --- a/demo_1.json +++ /dev/null @@ -1 +0,0 @@ -{"paragraphs":[{"text":"%mariadb\n\nSELECT * FROM demo.supers;\nSELECT * FROM demo.teams;\nSELECT * FROM demo.supersteams;\n","user":"anonymous","dateUpdated":"2020-02-25T18:23:02+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","alias":"string","type":"string","rescues":"string","mentor":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"1":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"2":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"supersid":"string","teamsid":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\talias\ttype\trescues\tmentor\tstartDate\tendDate\n1\tBruce Wayne\tBatman\tH\t192\t6\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n2\tClark Kent\tSuperman\tH\t257\tnull\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n3\tDiana Prince\tWonder Woman\tH\t212\tnull\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n4\tDick Grayson\tRobin/Nightwing\tH\t127\t1\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n5\tBeast Boy\tGar Logan\tH\t59\tnull\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n6\tRa's Ah Ghul\tThe Demon's Head\tV\t3\tnull\t2016-06-01 00:00:00.0\t2020-01-01 00:00:00.0\n7\tFrank Castle\tThe Punisher\tH\t37\tnull\t2016-01-01 00:00:00.0\t2020-01-01 00:00:00.0\n"},{"type":"TABLE","data":"id\tname\n1\tJustice League\n2\tTeen Titans\n"},{"type":"TABLE","data":"supersid\tteamsid\n1\t1\n2\t1\n3\t1\n4\t1\n4\t2\n5\t2\n"}]},"apps":[],"jobName":"paragraph_1582592903861_-1374110334","id":"20200225-010823_1623050505","dateCreated":"2020-02-25T01:08:23+0000","dateStarted":"2020-02-25T18:23:02+0000","dateFinished":"2020-02-25T18:23:02+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:15494"},{"text":"%mariadb\n\n/* Set Operators */\n\nSELECT\n alias, name\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.supersid\nWHERE \n st.teamsid = 1 \nunion\nSELECT \n alias, name\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.supersid\nWHERE \n st.teamsid = 2\n","user":"anonymous","dateUpdated":"2020-02-25T18:23:50+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{"columns":[{"name":"alias","visible":true,"width":283,"sort":{},"filters":[{}],"pinned":""},{"name":"name","visible":true,"width":"*","sort":{},"filters":[{}],"pinned":""}],"scrollFocus":{},"selection":[],"grouping":{"grouping":[],"aggregations":[],"rowExpandedStates":{}},"treeView":{},"pagination":{"paginationCurrentPage":1,"paginationPageSize":250}},"tableColumnTypeState":{"names":{"alias":"string","name":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[],"groups":[],"values":[]},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"alias\tname\nBatman\tBruce Wayne\nSuperman\tClark Kent\nWonder Woman\tDiana Prince\nRobin/Nightwing\tDick Grayson\nGar Logan\tBeast Boy\n"}]},"apps":[],"jobName":"paragraph_1582300336842_-1577980739","id":"20200221-155216_1283406480","dateCreated":"2020-02-21T15:52:16+0000","dateStarted":"2020-02-25T18:23:50+0000","dateFinished":"2020-02-25T18:23:50+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:15495"},{"text":"%mariadb\n\n/* Table Value Constructor */\n\nSELECT \n alias, name, rescues\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.supersid\nWHERE \n st.teamsid = 1\nUNION\nvalues ('The Developer','Rob Hedgpeth', 0)","user":"anonymous","dateUpdated":"2020-02-25T18:24:48+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"alias":"string","name":"string","rescues":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"alias\tname\trescues\nBatman\tBruce Wayne\t192\nSuperman\tClark Kent\t257\nWonder Woman\tDiana Prince\t212\nRobin/Nightwing\tDick Grayson\t127\nThe Developer\tRob Hedgpeth\t0\n"}]},"apps":[],"jobName":"paragraph_1582300348846_554719235","id":"20200221-155228_1601746996","dateCreated":"2020-02-21T15:52:28+0000","dateStarted":"2020-02-25T18:24:48+0000","dateFinished":"2020-02-25T18:24:48+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:15496"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2020-02-25T12:44:41+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1582634681244_-283978054","id":"20200225-124441_736827851","dateCreated":"2020-02-25T12:44:41+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:15497"},{"text":"%mariadb\n\n/* Aggregate function */\n\nSELECT \n t.name, sum(rescues) \nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.supersid INNER JOIN\n demo.teams AS t ON st.teamsid = t.id\nGROUP BY \n t.name;","user":"anonymous","dateUpdated":"2020-02-25T18:25:18+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"pieChart","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","sum(rescues)":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"pieChart":{}},"commonSetting":{},"keys":[{"name":"name","index":0,"aggr":"sum"}],"groups":[],"values":[{"name":"sum(rescues)","index":1,"aggr":"sum"}]},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tsum(rescues)\nJustice League\t788\nTeen Titans\t186\n"}]},"apps":[],"jobName":"paragraph_1582301836412_251366005","id":"20200221-161716_1319053968","dateCreated":"2020-02-21T16:17:16+0000","dateStarted":"2020-02-25T18:25:18+0000","dateFinished":"2020-02-25T18:25:18+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:15498"},{"text":"%mariadb\n\n/* Rollup */\n\nSELECT \n t.name, sum(rescues), avg(rescues)\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.supersid INNER JOIN\n demo.teams AS t ON st.teamsid = t.id\nGROUP BY \n t.name\nWITH ROLLUP;","user":"anonymous","dateUpdated":"2020-02-25T18:25:57+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","sum(rescues)":"string","avg(rescues)":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tsum(rescues)\tavg(rescues)\nJustice League\t788\t197.0000\nTeen Titans\t186\t93.0000\nnull\t974\t162.3333\n"}]},"apps":[],"jobName":"paragraph_1582302234615_-94625791","id":"20200221-162354_1044379253","dateCreated":"2020-02-21T16:23:54+0000","dateStarted":"2020-02-25T18:25:57+0000","dateFinished":"2020-02-25T18:25:57+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:15499"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2020-02-25T12:25:37+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","tableHide":false},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1582592500834_632747926","id":"20200225-010140_731550402","dateCreated":"2020-02-25T01:01:40+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:15500"}],"name":"Super Demo 1","id":"2EZUUVJM9","noteParams":{},"noteForms":{},"angularObjects":{"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/demo_2.json b/demo_2.json deleted file mode 100644 index e9218d6..0000000 --- a/demo_2.json +++ /dev/null @@ -1 +0,0 @@ -{"paragraphs":[{"text":"%mariadb\n\n/* Window function */\n\nSELECT \n alias, rescues, t.name, \n avg(rescues) OVER(PARTITION BY t.name) as team_avg\nFROM \n\tdemo.supers s INNER JOIN\n\tdemo.supersteams st ON s.id = st.supersid INNER JOIN\n\tdemo.teams t ON t.id = st.teamsid \nORDER BY\n\tt.name, rescues DESC","user":"anonymous","dateUpdated":"2020-02-26T23:20:35+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"multiBarChart","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"alias":"string","rescues":"string","name":"string","team_avg":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[{"name":"alias","index":0,"aggr":"sum"}],"groups":[{"name":"name","index":2,"aggr":"sum"}],"values":[{"name":"rescues","index":1,"aggr":"sum"},{"name":"team_avg","index":3,"aggr":"sum"}]},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"alias\trescues\tname\tteam_avg\nSuperman\t257\tJustice League\t197.0000\nWonder Woman\t212\tJustice League\t197.0000\nBatman\t192\tJustice League\t197.0000\nRobin/Nightwing\t127\tJustice League\t197.0000\nRobin/Nightwing\t127\tTeen Titans\t93.0000\nGar Logan\t59\tTeen Titans\t93.0000\n"}]},"apps":[],"jobName":"paragraph_1582303425423_1989076521","id":"20200221-164345_1042538520","dateCreated":"2020-02-21T16:43:45+0000","dateStarted":"2020-02-25T18:36:05+0000","dateFinished":"2020-02-25T18:36:05+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:20272"},{"text":"%mariadb\n\n/* Window function */\n\nSELECT \n alias,\n rescues,\n RANK() OVER (PARTITION BY t.name ORDER BY rescues DESC) AS rank,\n t.name,\n avg(rescues) OVER(PARTITION BY t.name) as team_avg\nFROM \n\tdemo.supers s INNER JOIN\n\tdemo.supersteams st ON s.id = st.supersid INNER JOIN\n\tdemo.teams t ON t.id = st.teamsid \nORDER BY\n\tt.name, rescues DESC","user":"anonymous","dateUpdated":"2020-02-25T18:36:39+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"alias":"string","rescues":"string","rank":"string","name":"string","team_avg":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"alias\trescues\trank\tname\tteam_avg\nSuperman\t257\t1\tJustice League\t197.0000\nWonder Woman\t212\t2\tJustice League\t197.0000\nBatman\t192\t3\tJustice League\t197.0000\nRobin/Nightwing\t127\t4\tJustice League\t197.0000\nRobin/Nightwing\t127\t1\tTeen Titans\t93.0000\nGar Logan\t59\t2\tTeen Titans\t93.0000\n"}]},"apps":[],"jobName":"paragraph_1582633908850_1689219716","id":"20200225-123148_905286346","dateCreated":"2020-02-25T12:31:48+0000","dateStarted":"2020-02-25T18:36:39+0000","dateFinished":"2020-02-25T18:36:39+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:20273"},{"text":"%mariadb\n\n/* Recursive Common Table Expression */\n\nWITH RECURSIVE heroes AS(\n\tSELECT id, alias, name, mentor\n\tFROM demo.supers\n\tWHERE name = 'Dick Grayson' \n UNION\n SELECT s.id, s.name, s.alias, s.mentor\n FROM demo.supers AS s, heroes AS h\n WHERE s.id = h.mentor \n)\nSELECT * FROM heroes ORDER BY mentor;","user":"anonymous","dateUpdated":"2020-02-25T18:38:42+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","alias":"string","name":"string","mentor":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\talias\tname\tmentor\n6\tRa's Ah Ghul\tThe Demon's Head\tnull\n4\tRobin/Nightwing\tDick Grayson\t1\n1\tBruce Wayne\tBatman\t6\n"}]},"apps":[],"jobName":"paragraph_1582312489741_-415225161","id":"20200221-191449_1158288725","dateCreated":"2020-02-21T19:14:49+0000","dateStarted":"2020-02-25T18:38:42+0000","dateFinished":"2020-02-25T18:38:42+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:20274"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2020-02-24T23:12:15+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1582585935753_-39603015","id":"20200224-231215_1591869176","dateCreated":"2020-02-24T23:12:15+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:20275"}],"name":"Super Demo 2","id":"2F1Q73W7J","noteParams":{},"noteForms":{},"angularObjects":{"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/demo_3.json b/demo_3.json deleted file mode 100644 index 3409651..0000000 --- a/demo_3.json +++ /dev/null @@ -1 +0,0 @@ -{"paragraphs":[{"text":"%mariadb\n\n/* Temporal Table - Application Time */\n\nSELECT \n id, name, alias, type, startDate, endDate\nFROM\n demo.supers\nWHERE \n name = 'Frank Castle' \nORDER BY \n startDate","user":"anonymous","dateUpdated":"2020-02-25T18:56:13+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","alias":"string","type":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"scatterChart":{"yAxis":{"name":"startDate","index":1,"aggr":"sum"},"group":{"name":"type","index":0,"aggr":"sum"},"xAxis":{"name":"endDate","index":2,"aggr":"sum"}},"pieChart":{},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"keys":[],"groups":[],"values":[],"commonSetting":{}},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\talias\ttype\tstartDate\tendDate\n17\tFrank Castle\tThe Punisher\tH\t2016-01-01 00:00:00.0\t2016-06-01 00:00:00.0\n7\tFrank Castle\tThe Punisher\tV\t2016-06-01 00:00:00.0\t2017-06-01 00:00:00.0\n18\tFrank Castle\tThe Punisher\tH\t2017-06-01 00:00:00.0\t2020-01-01 00:00:00.0\n"}]},"apps":[],"jobName":"paragraph_1582302441669_1528409790","id":"20200221-162721_22859113","dateCreated":"2020-02-21T16:27:21+0000","dateStarted":"2020-02-25T18:56:13+0000","dateFinished":"2020-02-25T18:56:13+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:22025"},{"text":"%mariadb\n\nUPDATE demo.supers\n FOR PORTION OF date_period\nFROM '2016-06-01' to '2017-06-01'\n SET type = 'V'\nWHERE id = 7","user":"anonymous","dateUpdated":"2020-02-25T18:56:06+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]},"apps":[],"jobName":"paragraph_1582320067715_487363913","id":"20200221-212107_406003971","dateCreated":"2020-02-21T21:21:07+0000","dateStarted":"2020-02-25T18:56:06+0000","dateFinished":"2020-02-25T18:56:06+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:22026"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2020-02-25T00:54:25+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1582592065740_-1031376089","id":"20200225-005425_624048741","dateCreated":"2020-02-25T00:54:25+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:22027"}],"name":"Super Demo 3","id":"2F13T1FEP","noteParams":{},"noteForms":{},"angularObjects":{"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/media/skysql.png b/media/skysql.png new file mode 100644 index 0000000..66666d2 Binary files /dev/null and b/media/skysql.png differ diff --git a/media/zeppelin.png b/media/zeppelin.png new file mode 100644 index 0000000..12d417f Binary files /dev/null and b/media/zeppelin.png differ diff --git a/sql/data.sql b/sql/data.sql new file mode 100644 index 0000000..50cdeaa --- /dev/null +++ b/sql/data.sql @@ -0,0 +1,38 @@ +USE demo; + +/* Add supers */ +INSERT INTO `supers` (`name`, `type`, `rescues`, `mentor`, `startDate`, `endDate`) +VALUES + ('Batman','H',192,6,'1997-01-01 00:00:00','2021-02-17 00:00:00'), + ('Superman','H',257,NULL,'1998-01-01 00:00:00','2021-02-17 00:00:00'), + ('Wonder Woman','H',212,NULL,'1985-01-01 00:00:00','2021-02-17 00:00:00'), + ('Robin/Nightwing','H',127,1,'2008-01-01 00:00:00','2021-02-17 00:00:00'), + ('Gar Logan','H',59,NULL,'2017-01-01 00:00:00','2021-02-17 00:00:00'), + ("Ra's Ah Ghul",'V',3,NULL,'1990-06-01 00:00:00','2021-02-17 00:00:00'), + ('The Punisher','V',37,NULL,'2003-01-01 00:00:00','2021-02-17 00:00:00'), + ('The Flash','H',297,NULL,'2001-01-01 00:00:00','2021-02-17 00:00:00'), + ('Kid Flash','H',61,NULL,'2018-01-01 00:00:00','2021-02-17 00:00:00'), + ('Catwoman','V',43,NULL,'1998-01-01 00:00:00','2021-02-17 00:00:00'); + +/* Add teams */ +INSERT INTO `teams` (`name`) +VALUES + ('Justice Society of America'), + ('Justice League of America'), + ('Teen Titans'); + +/* Add supers to teams */ +INSERT INTO `supersteams` (`superid`, `teamid`) +VALUES + (1,2), + (2,2), + (3,2), + (4,2), + (4,3), + (5,3), + (8,1), + (8,2), + (9,3); + + +/* mariadb --host transactions-1.mdb0001390.db.skysql.net --port 5002 --user DB00003108 -p'E30W9,614oI6/8s1pn7Vl8' --ssl-ca ~/Downloads/skysql_chain.pem < schema.sql */ \ No newline at end of file diff --git a/sql/demos.sql b/sql/demos.sql new file mode 100644 index 0000000..63a3831 --- /dev/null +++ b/sql/demos.sql @@ -0,0 +1,112 @@ + +/* Aggregate functions, Rollups/Super-Aggregates, + Table Value Constructors, Set Operators, Precedence Operators +*/ + +/* Aggregate functions */ +SELECT SUM(rescues) FROM demo.supers; + +/* Rollup / Super-aggregates */ +SELECT + t.name, AVG(rescues) as avg_rescues, SUM(rescues) as total_rescues +FROM + demo.supers AS s INNER JOIN + demo.supersteams AS st ON s.id = st.superid LEFT JOIN + demo.teams AS t ON st.teamid = t.id +GROUP BY + t.name +WITH ROLLUP; + +/* Set Operators */ +SELECT + name +FROM + demo.supers AS s INNER JOIN + demo.supersteams AS st ON s.id = st.superid +WHERE + st.teamid = 1 +UNION +SELECT + name +FROM + demo.supers AS s INNER JOIN + demo.supersteams AS st ON s.id = st.superid +WHERE + st.teamid = 2 + +/* Table Value Constructor */ +SELECT + name, rescues +FROM + demo.supers AS s INNER JOIN + demo.supersteams AS st ON s.id = st.superid +WHERE + st.teamid = 1 +UNION +values ('Super Developer', 0) + + +/* Window functions, Common Table Expressions (CTEs) */ + +/* Window function */ +SELECT + s.name as name, s.rescues, + RANK() OVER (PARTITION BY t.name ORDER BY s.rescues DESC) AS rank, + t.name as team, + sum(rescues) OVER(PARTITION BY t.name) as team_total +FROM + demo.supers s INNER JOIN + demo.supersteams st ON s.id = st.superid INNER JOIN + demo.teams t ON t.id = st.teamid +ORDER BY + t.name, s.rescues DESC + +/* Non-recursive CTE */ +WITH new_heroes AS ( + SELECT + * + FROM + demo.supers + WHERE + rescues < 150 and + type = 'H' +) + +SELECT * FROM new_heroes +INTERSECT +SELECT s.* +FROM + demo.supers s + INNER JOIN demo.supersteams st ON s.id = st.superid + INNER JOIN demo.teams t ON st.teamid = t.id +WHERE + t.id = 2; + +/* Recursive CTE */ +WITH RECURSIVE mentors AS( + SELECT id, name, mentor + FROM demo.supers + WHERE name = 'Robin/Nightwing' + UNION + SELECT s.id, s.name, s.mentor + FROM demo.supers AS s, mentors AS h + WHERE s.id = h.mentor +) +SELECT * FROM mentors; + +/* Temporal Table - Application Time */ + +UPDATE demo.supers + FOR PORTION OF date_period +FROM '2009-01-01' to '2019-12-31' + SET type = 'H' +WHERE id = 10 + +SELECT + id, name, type, startDate, endDate +FROM + demo.supers +WHERE + name = 'Catwoman' +ORDER BY + startDate \ No newline at end of file diff --git a/sql/schema.sql b/sql/schema.sql new file mode 100644 index 0000000..e1f78d4 --- /dev/null +++ b/sql/schema.sql @@ -0,0 +1,28 @@ +DROP DATABASE IF EXISTS demo; + +CREATE DATABASE demo; + +USE demo; + +CREATE TABLE `supers` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL DEFAULT '', + `type` char(1) NOT NULL DEFAULT '', + `rescues` int(11) NOT NULL, + `mentor` int(11) DEFAULT NULL, + `startDate` datetime NOT NULL, + `endDate` datetime NOT NULL, + PRIMARY KEY (`id`), + PERIOD FOR `date_period` (`startDate`, `endDate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `supersteams` ( + `superid` int(11) unsigned NOT NULL, + `teamid` int(11) unsigned NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `teams` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/bitemporal-table-demo.json b/zeppelin/bitemporal-table-demo.json similarity index 100% rename from bitemporal-table-demo.json rename to zeppelin/bitemporal-table-demo.json diff --git a/zeppelin/demo_1.json b/zeppelin/demo_1.json new file mode 100644 index 0000000..b7b4b51 --- /dev/null +++ b/zeppelin/demo_1.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\nSELECT * FROM demo.supers;\nSELECT * FROM demo.teams;\nSELECT * FROM demo.supersteams;\n","user":"anonymous","dateUpdated":"2021-02-11T19:35:59+0000","config":{"tableHide":false,"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","type":"string","rescues":"string","mentor":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"1":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"2":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"superid":"string","teamid":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[{"name":"supersid","index":0,"aggr":"sum"}],"groups":[],"values":[{"name":"teamsid","index":1,"aggr":"sum"}]},"helium":{}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\ttype\trescues\tmentor\tstartDate\tendDate\n1\tBatman\tH\t192\t6\t1997-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n2\tSuperman\tH\t257\tnull\t1998-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n3\tWonder Woman\tH\t212\tnull\t1985-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n4\tRobin/Nightwing\tH\t127\t1\t2008-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n5\tGar Logan\tH\t59\tnull\t2017-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n6\tRa's Ah Ghul\tV\t3\tnull\t1990-06-01 00:00:00.0\t2021-02-17 00:00:00.0\n7\tThe Punisher\tV\t37\tnull\t2003-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n8\tThe Flash\tH\t297\tnull\t2001-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n9\tKid Flash\tH\t61\tnull\t2018-01-01 00:00:00.0\t2021-02-17 00:00:00.0\n10\tCatwoman\tH\t43\tnull\t2009-01-01 00:00:00.0\t2019-12-31 00:00:00.0\n11\tCatwoman\tV\t43\tnull\t1998-01-01 00:00:00.0\t2009-01-01 00:00:00.0\n12\tCatwoman\tV\t43\tnull\t2019-12-31 00:00:00.0\t2021-02-17 00:00:00.0\n"},{"type":"TABLE","data":"id\tname\n1\tJustice Society of America\n2\tJustice League of America\n3\tTeen Titans\n"},{"type":"TABLE","data":"superid\tteamid\n1\t2\n2\t2\n3\t2\n4\t2\n4\t3\n5\t3\n8\t1\n8\t2\n9\t3\n"}]},"apps":[],"jobName":"paragraph_1612977054214_-974005462","id":"20200225-010823_1623050505","dateCreated":"2021-02-10T17:10:54+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:364","dateFinished":"2021-02-11T19:35:58+0000","dateStarted":"2021-02-11T19:35:57+0000"},{"text":"%mariadb\n\n/* Set Operators */\n\nSELECT\n name\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid\nWHERE \n st.teamid = 1 \nUNION\nSELECT \n name\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid\nWHERE \n st.teamid = 2\n","user":"anonymous","dateUpdated":"2021-02-11T19:37:07+0000","config":{"tableHide":false,"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{"columns":[{"name":"alias","visible":true,"width":283,"sort":{},"filters":[{}],"pinned":""},{"name":"name","visible":true,"width":"*","sort":{},"filters":[{}],"pinned":""}],"scrollFocus":{},"selection":[],"grouping":{"grouping":[],"aggregations":[],"rowExpandedStates":{}},"treeView":{},"pagination":{"paginationCurrentPage":1,"paginationPageSize":250}},"tableColumnTypeState":{"names":{"name":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[],"groups":[],"values":[]},"helium":{}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\nThe Flash\nBatman\nSuperman\nWonder Woman\nRobin/Nightwing\n"}]},"apps":[],"jobName":"paragraph_1612977054215_182046073","id":"20200221-155216_1283406480","dateCreated":"2021-02-10T17:10:54+0000","dateStarted":"2021-02-11T19:37:07+0000","dateFinished":"2021-02-11T19:37:07+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:365"},{"text":"%mariadb\n\n/* Table Value Constructor */\n\nSELECT \n name, rescues\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid\nWHERE \n st.teamid = 1\nUNION\nvalues ('Super Developer', 0)","user":"anonymous","dateUpdated":"2021-02-11T19:37:22+0000","config":{"tableHide":false,"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","rescues":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\trescues\nThe Flash\t297\nSuper Developer\t0\n"}]},"apps":[],"jobName":"paragraph_1612977054216_-288226118","id":"20200221-155228_1601746996","dateCreated":"2021-02-10T17:10:54+0000","dateStarted":"2021-02-11T19:37:22+0000","dateFinished":"2021-02-11T19:37:22+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:366"},{"text":"%mariadb\n\n/* Aggregate function */\n\nSELECT \n t.name, sum(rescues) \nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid INNER JOIN\n demo.teams AS t ON st.teamid = t.id\nGROUP BY \n t.name;","user":"anonymous","dateUpdated":"2021-02-11T19:37:38+0000","config":{"tableHide":false,"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"pieChart","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","sum(rescues)":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"pieChart":{}},"commonSetting":{},"keys":[{"name":"name","index":0,"aggr":"sum"}],"groups":[],"values":[{"name":"sum(rescues)","index":1,"aggr":"sum"}]},"helium":{}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tsum(rescues)\nJustice League of America\t1085\nJustice Society of America\t297\nTeen Titans\t247\n"}]},"apps":[],"jobName":"paragraph_1612977054216_89242961","id":"20200221-161716_1319053968","dateCreated":"2021-02-10T17:10:54+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:368","dateFinished":"2021-02-11T19:37:38+0000","dateStarted":"2021-02-11T19:37:38+0000"},{"text":"%mariadb\n\n/* Rollup */\n\nSELECT \n t.name, sum(rescues), avg(rescues)\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid INNER JOIN\n demo.teams AS t ON st.teamid = t.id\nGROUP BY \n t.name\nWITH ROLLUP;","user":"anonymous","dateUpdated":"2021-02-11T19:37:56+0000","config":{"tableHide":false,"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","sum(rescues)":"string","avg(rescues)":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tsum(rescues)\tavg(rescues)\nJustice League of America\t1085\t217.0000\nJustice Society of America\t297\t297.0000\nTeen Titans\t247\t82.3333\nnull\t1629\t181.0000\n"}]},"apps":[],"jobName":"paragraph_1612977054217_-1124801947","id":"20200221-162354_1044379253","dateCreated":"2021-02-10T17:10:54+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:369","dateFinished":"2021-02-11T19:37:56+0000","dateStarted":"2021-02-11T19:37:56+0000"}],"name":"Super Demo 1","id":"2FXMC2MUQ","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/zeppelin/demo_2.json b/zeppelin/demo_2.json new file mode 100644 index 0000000..4a9bd77 --- /dev/null +++ b/zeppelin/demo_2.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\n/* Window function */\n\nSELECT \n s.name as super, t.name as team, s.rescues,\n avg(s.rescues) OVER(PARTITION BY t.name) as team_avg\nFROM \n\tdemo.supers s INNER JOIN\n\tdemo.supersteams st ON s.id = st.superid INNER JOIN\n\tdemo.teams t ON t.id = st.teamid \nORDER BY\n\tt.name, s.rescues DESC","user":"anonymous","dateUpdated":"2021-02-11T19:43:55+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"super":"string","team":"string","rescues":"string","team_avg":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[],"groups":[{"name":"name","index":2,"aggr":"sum"}],"values":[{"name":"rescues","index":1,"aggr":"sum"},{"name":"team_avg","index":3,"aggr":"sum"}]},"helium":{}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"super\tteam\trescues\tteam_avg\nThe Flash\tJustice League of America\t297\t217.0000\nSuperman\tJustice League of America\t257\t217.0000\nWonder Woman\tJustice League of America\t212\t217.0000\nBatman\tJustice League of America\t192\t217.0000\nRobin/Nightwing\tJustice League of America\t127\t217.0000\nThe Flash\tJustice Society of America\t297\t297.0000\nRobin/Nightwing\tTeen Titans\t127\t82.3333\nKid Flash\tTeen Titans\t61\t82.3333\nGar Logan\tTeen Titans\t59\t82.3333\n"}]},"apps":[],"jobName":"paragraph_1612978340144_-354940344","id":"20200221-164345_1042538520","dateCreated":"2021-02-10T17:32:20+0000","dateStarted":"2021-02-11T19:43:55+0000","dateFinished":"2021-02-11T19:43:55+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:7440"},{"text":"%mariadb\n\n/* Window function */\n\nSELECT \n s.name as name, s.rescues,\n RANK() OVER (PARTITION BY t.name ORDER BY s.rescues DESC) AS rank,\n t.name as team,\n sum(rescues) OVER(PARTITION BY t.name) as team_total\nFROM \n\tdemo.supers s INNER JOIN\n\tdemo.supersteams st ON s.id = st.superid INNER JOIN\n\tdemo.teams t ON t.id = st.teamid \nORDER BY\n\tteam_total DESC, rank ASC","user":"anonymous","dateUpdated":"2021-02-11T19:43:51+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","rescues":"string","rank":"string","team":"string","team_total":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\trescues\trank\tteam\tteam_total\nThe Flash\t297\t1\tJustice League of America\t1085\nSuperman\t257\t2\tJustice League of America\t1085\nWonder Woman\t212\t3\tJustice League of America\t1085\nBatman\t192\t4\tJustice League of America\t1085\nRobin/Nightwing\t127\t5\tJustice League of America\t1085\nThe Flash\t297\t1\tJustice Society of America\t297\nRobin/Nightwing\t127\t1\tTeen Titans\t247\nKid Flash\t61\t2\tTeen Titans\t247\nGar Logan\t59\t3\tTeen Titans\t247\n"}]},"apps":[],"jobName":"paragraph_1612978340145_1855337025","id":"20200225-123148_905286346","dateCreated":"2021-02-10T17:32:20+0000","dateStarted":"2021-02-11T19:43:51+0000","dateFinished":"2021-02-11T19:43:51+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:7441"},{"text":"%mariadb\n\n/* Recursive Common Table Expression */\n\nWITH RECURSIVE heroes AS(\n\tSELECT id, name, mentor\n\tFROM demo.supers\n\tWHERE name = 'Robin/Nightwing' \n UNION\n SELECT s.id, s.name, s.mentor\n FROM demo.supers AS s, heroes AS h\n WHERE s.id = h.mentor \n)\nSELECT * FROM heroes;","user":"anonymous","dateUpdated":"2021-02-10T17:41:42+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","mentor":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\tmentor\n4\tRobin/Nightwing\t1\n1\tBatman\t6\n6\tRa's Ah Ghul\tnull\n"}]},"apps":[],"jobName":"paragraph_1612978340145_-370546452","id":"20200221-191449_1158288725","dateCreated":"2021-02-10T17:32:20+0000","dateStarted":"2021-02-10T17:41:42+0000","dateFinished":"2021-02-10T17:41:42+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:7442"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2021-02-10T17:32:20+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{},"enabled":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1612978340145_77353919","id":"20200224-231215_1591869176","dateCreated":"2021-02-10T17:32:20+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:7443"}],"name":"Super Demo 2","id":"2FX93GQN4","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/zeppelin/demo_3.json b/zeppelin/demo_3.json new file mode 100644 index 0000000..b37b0da --- /dev/null +++ b/zeppelin/demo_3.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\n/* Temporal Table - Application Time */\n\nSELECT \n id, name, type, startDate, endDate\nFROM\n demo.supers\nWHERE \n name = 'The Punisher' \nORDER BY \n startDate","user":"anonymous","dateUpdated":"2021-02-10T17:46:20+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","type":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"lineChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"scatterChart":{"yAxis":{"name":"startDate","index":1,"aggr":"sum"},"group":{"name":"type","index":0,"aggr":"sum"},"xAxis":{"name":"endDate","index":2,"aggr":"sum"}},"pieChart":{},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"keys":[],"groups":[],"values":[],"commonSetting":{}},"helium":{}}},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\ttype\tstartDate\tendDate\n7\tThe Punisher\tV\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n"}]},"apps":[],"jobName":"paragraph_1612979152366_-1085081086","id":"20200221-162721_22859113","dateCreated":"2021-02-10T17:45:52+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:22415","dateFinished":"2021-02-10T17:46:20+0000","dateStarted":"2021-02-10T17:46:20+0000"},{"text":"%mariadb\n\nUPDATE demo.supers\n FOR PORTION OF date_period\nFROM '2016-06-01' to '2017-06-01'\n SET type = 'V'\nWHERE id = 7","user":"anonymous","dateUpdated":"2021-02-10T17:45:52+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{},"enabled":true},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]},"apps":[],"jobName":"paragraph_1612979152366_381009384","id":"20200221-212107_406003971","dateCreated":"2021-02-10T17:45:52+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:22416"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2021-02-10T17:45:52+0000","config":{"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"colWidth":12,"editorMode":"ace/mode/sql","fontSize":9,"results":{},"enabled":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1612979152366_-2022099143","id":"20200225-005425_624048741","dateCreated":"2021-02-10T17:45:52+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:22417"}],"name":"Super Demo 3","id":"2FYDB43HF","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/zeppelin/demo_4.json b/zeppelin/demo_4.json new file mode 100644 index 0000000..e4437fd --- /dev/null +++ b/zeppelin/demo_4.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\nSELECT * FROM demo.supers;\nSELECT * FROM demo.teams;\nSELECT * FROM demo.supersteams;","user":"anonymous","dateUpdated":"2021-02-11T14:51:03+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","type":"string","rescues":"string","mentor":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"1":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}},"2":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"supersid":"string","teamsid":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":false},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\ttype\trescues\tmentor\tstartDate\tendDate\n1\tBatman\tH\t192\t6\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n2\tSuperman\tH\t257\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n3\tWonder Woman\tH\t212\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n4\tRobin/Nightwing\tH\t127\t1\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n5\tGar Logan\tH\t59\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n6\tRa's Ah Ghul\tV\t3\tnull\t2018-06-01 00:00:00.0\t2021-01-01 00:00:00.0\n7\tThe Punisher\tV\t37\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n8\tThe Flash\tH\t297\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n9\tKid Flash\tH\t59\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n"},{"type":"TABLE","data":"id\tname\n1\tJustice Society of America\n2\tJustice League of America\n3\tTeen Titans\n"},{"type":"TABLE","data":"supersid\tteamsid\n1\t2\n2\t2\n3\t2\n4\t2\n4\t3\n5\t3\n8\t1\n8\t2\n9\t3\n"}]},"apps":[],"jobName":"paragraph_1612977276498_-1246631679","id":"20210210-171436_1854143214","dateCreated":"2021-02-10T17:14:36+0000","dateStarted":"2021-02-10T17:49:17+0000","dateFinished":"2021-02-10T17:49:17+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:364"},{"text":"%mariadb\n\nSELECT SUM(rescues) FROM demo.supers;\n","user":"anonymous","dateUpdated":"2021-02-11T20:49:08+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"sum(rescues)":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[{"name":"sum(rescues)","index":0,"aggr":"sum"}],"groups":[],"values":[{"name":"avg(rescues)","index":1,"aggr":"sum"}]},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"sum(rescues)\n1245\n"}]},"apps":[],"jobName":"paragraph_1612979330901_562254231","id":"20210210-174850_333955436","dateCreated":"2021-02-10T17:48:50+0000","dateStarted":"2021-02-11T16:19:57+0000","dateFinished":"2021-02-11T16:19:57+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:365"},{"text":"%mariadb\n\nSELECT \n t.name, AVG(rescues) as avg_rescues, SUM(rescues) as total_rescues\nFROM \n demo.supers AS s INNER JOIN\n demo.supersteams AS st ON s.id = st.superid LEFT JOIN\n demo.teams AS t ON st.teamid = t.id\nGROUP BY \n t.name\nWITH ROLLUP;\n","user":"anonymous","dateUpdated":"2021-02-11T16:27:56+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","avg_rescues":"string","total_rescues":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false},"stackedAreaChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"},"multiBarChart":{"rotate":{"degree":"-45"},"xLabelStatus":"default"}},"commonSetting":{},"keys":[{"name":"name","index":0,"aggr":"sum"}],"groups":[],"values":[]},"helium":{}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tavg_rescues\ttotal_rescues\nJustice League of America\t217.0000\t1085\nJustice Society of America\t297.0000\t297\nTeen Titans\t82.3333\t247\nnull\t181.0000\t1629\n"}]},"apps":[],"jobName":"paragraph_1612977417857_333280587","id":"20210210-171657_1805504904","dateCreated":"2021-02-10T17:16:57+0000","dateStarted":"2021-02-11T16:15:00+0000","dateFinished":"2021-02-11T16:15:00+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:366"},{"text":"%mariadb\n\nSELECT \n t.name, avg(rescues) as avg_rescues, sum(rescues) as total_rescues\nFROM \n (SELECT id, rescues FROM demo.supers UNION values (99,9999)) s INNER JOIN\n (SELECT superid, teamid FROM demo.supersteams UNION values (99,3)) st ON s.id = st.superid LEFT JOIN\n demo.teams AS t ON st.teamid = t.id\nGROUP BY \n t.name\nWITH ROLLUP;","user":"anonymous","dateUpdated":"2021-02-11T16:27:28+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","avg_rescues":"string","total_rescues":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\tavg_rescues\ttotal_rescues\nJustice League of America\t217.0000\t1085\nJustice Society of America\t297.0000\t297\nTeen Titans\t2561.5000\t10246\nnull\t1162.8000\t11628\n"}]},"apps":[],"jobName":"paragraph_1613060528261_-720144261","id":"20210211-162208_539840863","dateCreated":"2021-02-11T16:22:08+0000","dateStarted":"2021-02-11T16:26:31+0000","dateFinished":"2021-02-11T16:26:31+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:367"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2021-02-11T16:24:40+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1613060680623_-456494054","id":"20210211-162440_885135701","dateCreated":"2021-02-11T16:24:40+0000","status":"READY","progressUpdateIntervalMs":500,"$$hashKey":"object:368"}],"name":"Demo 1","id":"2FZUWCGP8","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/zeppelin/demo_5.json b/zeppelin/demo_5.json new file mode 100644 index 0000000..cadf276 --- /dev/null +++ b/zeppelin/demo_5.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\n/* Window function */\n\nSELECT \n s.name as name, s.rescues,\n RANK() OVER (PARTITION BY t.name ORDER BY s.rescues DESC) AS rank,\n t.name as team,\n sum(rescues) OVER(PARTITION BY t.name) as team_total\nFROM \n\tdemo.supers s INNER JOIN\n\tdemo.supersteams st ON s.id = st.superid INNER JOIN\n\tdemo.teams t ON t.id = st.teamid \nORDER BY\n\tt.name, s.rescues DESC","user":"anonymous","dateUpdated":"2021-02-11T19:43:22+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"name":"string","rescues":"string","rank":"string","team":"string","team_total":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"name\trescues\trank\tteam\tteam_total\nThe Flash\t297\t1\tJustice League of America\t1085\nSuperman\t257\t2\tJustice League of America\t1085\nWonder Woman\t212\t3\tJustice League of America\t1085\nBatman\t192\t4\tJustice League of America\t1085\nRobin/Nightwing\t127\t5\tJustice League of America\t1085\nThe Flash\t297\t1\tJustice Society of America\t297\nRobin/Nightwing\t127\t1\tTeen Titans\t247\nKid Flash\t61\t2\tTeen Titans\t247\nGar Logan\t59\t3\tTeen Titans\t247\n"}]},"apps":[],"jobName":"paragraph_1612979700487_1656137063","id":"20210210-175500_553692732","dateCreated":"2021-02-10T17:55:00+0000","dateStarted":"2021-02-11T19:42:43+0000","dateFinished":"2021-02-11T19:42:43+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:7269"},{"text":"%mariadb\n\n/* Non-recursive CTE */\n\nWITH new_heroes AS (\n SELECT \n *\n FROM \n demo.supers\n WHERE \n rescues < 150 and\n type = 'H'\n)\n\nSELECT * FROM new_heroes;\n\n/*\nSELECT \n *\nFROM \n new_heroes \n \nINTERSECT\n\nSELECT \n s.*\nFROM \n demo.supers s \n INNER JOIN demo.supersteams st ON s.id = st.superid \n INNER JOIN demo.teams t ON st.teamid = t.id\nWHERE \n t.id = 2;\n*/\n\n \n","user":"anonymous","dateUpdated":"2021-02-11T16:10:57+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","type":"string","rescues":"string","mentor":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\ttype\trescues\tmentor\tstartDate\tendDate\n4\tRobin/Nightwing\tH\t127\t1\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n5\tGar Logan\tH\t59\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n9\tKid Flash\tH\t61\tnull\t2018-01-01 00:00:00.0\t2021-01-01 00:00:00.0\n"},{"type":"TEXT","data":"Query executed successfully. Affected rows : 0"}]},"apps":[],"jobName":"paragraph_1613058287403_1727496317","id":"20210211-154447_328814834","dateCreated":"2021-02-11T15:44:47+0000","dateStarted":"2021-02-11T16:09:35+0000","dateFinished":"2021-02-11T16:09:35+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:7270"},{"text":"%mariadb\n\n/* Recursive Common Table Expression */\n\nWITH RECURSIVE mentors AS(\n\tSELECT id, name, mentor\n\tFROM demo.supers\n\tWHERE name = 'Robin/Nightwing' \n UNION\n SELECT s.id, s.name, s.mentor\n FROM demo.supers AS s, mentors AS h\n WHERE s.id = h.mentor \n)\nSELECT * FROM mentors;","user":"anonymous","dateUpdated":"2021-02-11T16:51:17+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","mentor":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\tmentor\n4\tRobin/Nightwing\t1\n1\tBatman\t6\n6\tRa's Ah Ghul\tnull\n"}]},"apps":[],"jobName":"paragraph_1612979862508_-1098150353","id":"20210210-175742_1584318144","dateCreated":"2021-02-10T17:57:42+0000","dateStarted":"2021-02-11T16:51:18+0000","dateFinished":"2021-02-11T16:51:18+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:7271"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2021-02-11T15:47:30+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1613058450168_1627869458","id":"20210211-154730_136544012","dateCreated":"2021-02-11T15:47:30+0000","status":"READY","progressUpdateIntervalMs":500,"$$hashKey":"object:7272"}],"name":"Demo 2","id":"2FW8X888W","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file diff --git a/zeppelin/demo_6.json b/zeppelin/demo_6.json new file mode 100644 index 0000000..abfd2c8 --- /dev/null +++ b/zeppelin/demo_6.json @@ -0,0 +1 @@ +{"paragraphs":[{"text":"%mariadb\n\n/* Temporal Table - Application Time */\n\nSELECT \n id, name, type, startDate, endDate\nFROM\n demo.supers\nWHERE \n name = 'Catwoman' \nORDER BY \n startDate","user":"anonymous","dateUpdated":"2021-02-11T16:43:05+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","name":"string","type":"string","startDate":"string","endDate":"string"},"updated":false},"tableOptionSpecHash":"[{\"name\":\"useFilter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable filter for columns\"},{\"name\":\"showPagination\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable pagination for better navigation\"},{\"name\":\"showAggregationFooter\",\"valueType\":\"boolean\",\"defaultValue\":false,\"widget\":\"checkbox\",\"description\":\"Enable a footer for displaying aggregated values\"}]","tableOptionValue":{"useFilter":false,"showPagination":false,"showAggregationFooter":false},"updated":false,"initialized":false}},"commonSetting":{}}}},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tname\ttype\tstartDate\tendDate\n11\tCatwoman\tV\t1998-01-01 00:00:00.0\t2009-01-01 00:00:00.0\n10\tCatwoman\tH\t2009-01-01 00:00:00.0\t2019-12-31 00:00:00.0\n12\tCatwoman\tV\t2019-12-31 00:00:00.0\t2021-02-17 00:00:00.0\n"}]},"apps":[],"jobName":"paragraph_1613061418475_-217930732","id":"20210211-163658_108226562","dateCreated":"2021-02-11T16:36:58+0000","dateStarted":"2021-02-11T16:43:05+0000","dateFinished":"2021-02-11T16:43:05+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:9853"},{"text":"%mariadb\n\nUPDATE demo.supers\n FOR PORTION OF date_period\nFROM '2009-01-01' to '2019-12-31'\n SET type = 'H'\nWHERE id = 10\n","user":"anonymous","dateUpdated":"2021-02-11T16:43:00+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]},"apps":[],"jobName":"paragraph_1613061444335_-812742646","id":"20210211-163724_1830642047","dateCreated":"2021-02-11T16:37:24+0000","dateStarted":"2021-02-11T16:43:00+0000","dateFinished":"2021-02-11T16:43:00+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:9854"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2021-02-11T16:39:06+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql"},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1613061546689_-155980516","id":"20210211-163906_362364857","dateCreated":"2021-02-11T16:39:06+0000","status":"READY","progressUpdateIntervalMs":500,"$$hashKey":"object:9855"}],"name":"Demo 3","id":"2FYFPQNE2","noteParams":{},"noteForms":{},"angularObjects":{"jdbc:shared_process":[],"mariadb:shared_process":[],"spark:shared_process":[]},"config":{"isZeppelinNotebookCronEnable":false,"looknfeel":"default","personalizedMode":"false"},"info":{}} \ No newline at end of file