diff --git a/Orders/README.md b/Orders/README.md index 8702534..095f265 100644 --- a/Orders/README.md +++ b/Orders/README.md @@ -48,7 +48,7 @@ This sample was tested on macOS v.10.14.6. ### Getting start with MariaDB -To download and deploy MariaDB HTAP 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). +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 diff --git a/README.md b/README.md index b6c4130..aa8a0c3 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,21 @@ This repository contains samples applications demonstrating the power of MariaDB! -## [Bookings](Bookings) +## [Bookings](bookings) **Bookings** is a web application written in [React.js](https://reactjs.org) and [Node.js](https://nodejs.org) that, backed by the power of the [MariaDB Node.js Connector](https://github.com/MariaDB/mariadb-connector-nodejs) and the [MariaDB X4 Platform](https://mariadb.com/resources/blog/deploying-mariadb-platform-x4/#smart), unleashes the power of [smart transactions](https://mariadb.com/resources/blog/introducing-mariadb-platform-x4-smart-transactions-and-cloud-native-storage/) on hundreds of millions of records with sub-second query performance without having to add any indexes! -## [Flights](Flights) +## [Flights](flights) **Flights** is a web application written in [React.js](https://reactjs.org) and [Node.js](https://nodejs.org) that, backed by the power of the [MariaDB Node.js Connector](https://github.com/MariaDB/mariadb-connector-nodejs) and [MariaDB ColumnStore database](https://mariadb.com/docs/features/mariadb-columnstore/), allows you to analyze over 180 million [flight records from the United States Department of Transportation](https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time) in real time without needing to add any indexes! -## [Orders](Orders) +## [Modern SQL Samples](modern-sql) + +[MariaDB](http://www.mariadb.com) implements more of the standard SQL specification than any other open source database, adding support for [common table expressions (CTEs)](https://mariadb.com/kb/en/with/), [window functions](https://mariadb.com/kb/en/window-functions/), [temporal data tables](https://mariadb.com/kb/en/temporal-data-tables/) and many other features over the last few years. + +## [Orders](orders) **Orders** is a web application written in [React.js](https://reactjs.org) and [Node.js](https://nodejs.org) that, backed by the power of the [MariaDB Node.js Connector](https://github.com/MariaDB/mariadb-connector-nodejs), introduces you to the power, performance, and simplicity of [MariaDB](https://mariadb.com/products/). -## [Places](Places) +## [Places](places) **Places** is a web application written in [React.js](https://reactjs.org) and [Node.js](https://nodejs.org) that, backed by the power of the [MariaDB Node.js Connector](https://github.com/MariaDB/mariadb-connector-nodejs) and [MariaDB platform](https://mariadb.com/products/mariadb-platform/), allows you to record all of your favorite locations! ## Support and Contribution diff --git a/modern-sql/README.md b/modern-sql/README.md new file mode 100644 index 0000000..e323a8d --- /dev/null +++ b/modern-sql/README.md @@ -0,0 +1,124 @@ +# Modern SQL, MariaDB, and Apache Zeppelin! + +[MariaDB](http://www.mariadb.com) implements more of the standard SQL specification than any other open source database, adding support for [common table expressions (CTEs)](https://mariadb.com/kb/en/with/), [window functions](https://mariadb.com/kb/en/window-functions/), [temporal data tables](https://mariadb.com/kb/en/temporal-data-tables/) and many other features over the last few years. + +
+ + + +
+ +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) + +## 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 you can create the schema necessary for this application by running + +``` +$ /+ + + +
+ +2. Click the "Create" button. + +3. Enter a name for the interpreter and select an "Interpreter group" of `jdbc`. + ++ + + +
+ +4. Assign value of **org.mariadb.jdbc.Driver** to `default.driver`. + +5. Assign value of **jdbc:mariadb://+ + + +
+ +### Importing the notebooks + +Import the notes: + +* [demo_1.json](demo_1.json) +* [demo_2.json](demo_2.json) +* [demo_3.json](demo_3.json) + +by selecting "Import note". + ++ + + +
+ + +## Support and Contribution + +If you have any questions, comments, or would like to contribute to this or future projects like this please reach out to us directly at developers@mariadb.com or on [Twitter](https://twitter.com/mariadb). + +## License +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=plastic)](https://opensource.org/licenses/Apache-2.0) diff --git a/modern-sql/create_schema_data.sql b/modern-sql/create_schema_data.sql new file mode 100644 index 0000000..711814c --- /dev/null +++ b/modern-sql/create_schema_data.sql @@ -0,0 +1,73 @@ +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/modern-sql/demo_1.json b/modern-sql/demo_1.json new file mode 100644 index 0000000..cb92ae4 --- /dev/null +++ b/modern-sql/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":"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/modern-sql/demo_2.json b/modern-sql/demo_2.json new file mode 100644 index 0000000..e9218d6 --- /dev/null +++ b/modern-sql/demo_2.json @@ -0,0 +1 @@ +{"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/modern-sql/demo_3.json b/modern-sql/demo_3.json new file mode 100644 index 0000000..3409651 --- /dev/null +++ b/modern-sql/demo_3.json @@ -0,0 +1 @@ +{"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/modern-sql/media/artifact.png b/modern-sql/media/artifact.png new file mode 100644 index 0000000..efc7e64 Binary files /dev/null and b/modern-sql/media/artifact.png differ diff --git a/modern-sql/media/demo.gif b/modern-sql/media/demo.gif new file mode 100644 index 0000000..937a3d5 Binary files /dev/null and b/modern-sql/media/demo.gif differ diff --git a/modern-sql/media/import.png b/modern-sql/media/import.png new file mode 100644 index 0000000..ff1e78f Binary files /dev/null and b/modern-sql/media/import.png differ diff --git a/modern-sql/media/interpreter.png b/modern-sql/media/interpreter.png new file mode 100644 index 0000000..a302599 Binary files /dev/null and b/modern-sql/media/interpreter.png differ diff --git a/modern-sql/media/name.png b/modern-sql/media/name.png new file mode 100644 index 0000000..8cb3e79 Binary files /dev/null and b/modern-sql/media/name.png differ diff --git a/modern-sql/media/platform.png b/modern-sql/media/platform.png new file mode 100644 index 0000000..5189f12 Binary files /dev/null and b/modern-sql/media/platform.png differ