diff --git a/README.md b/README.md index f49f535..337d3ac 100644 --- a/README.md +++ b/README.md @@ -19,5 +19,8 @@ This repository contains samples applications demonstrating the power of MariaDB ## [Places](https://github.com/mariadb-corporation/dev-example-places) **Places** is a web application that, backed by the power of MariaDB connectors and [MariaDB platform](https://mariadb.com/products/mariadb-platform/), allows you to record all of your favorite locations! +## [TODO](https://github.com/mariadb-corporation/dev-example-todo) +**TODO** is a web application that that introduces you to the power, performance and simplicity of [MariaDB](https://mariadb.com/products/). Through the use of simple task management you'll learn how to interact with MariaDB databases and perform simple CRUD operations! + ## 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). diff --git a/bookings/README.md b/bookings/README.md index 77c5433..fff896e 100644 --- a/bookings/README.md +++ b/bookings/README.md @@ -3,366 +3,3 @@ This application is no longer being maintained here. It has been moved to [**this repository**](https://github.com/mariadb-corporation/dev-example-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! - -
- - - -
- -The following will walk you through the steps for getting this application up and running (locally) within minutes! This application is completely open source. Please feel free to use it and the source code as you see fit. - -# Table of Contents -1. [Environment and Compatibility](#compatibility) -2. [Getting started with MariaDB and Hybrid Transactional-Analytical Processing](#overview) - 1. [The Basics](#intro-mariadb) - 2. [Deploying MariaDB HTAP](#installation) - 3. [Clone repo](#clone-repo) - 3. [Retrieving flight data](#retrieve-data) - 4. [Create the schema](#create-schema) - 5. [Load airport, airline, and flight data](#load-data) - 6. [Setting up replication](#replication) -3. [Requirements to run the app](#requirements) -4. [Getting started with the app](#getting-started) - 1. [Grab the code](#grab-code) - 2. [Build the code](#build-code) - 3. [Run the app](#run-app) - 4. [Adding app data](#create-data) -5. [Smart Transactions](#smart-transactions) -6. [Cross-Engine Queries](#cross-engine-queries) -7. [Support and Contribution](#support-contribution) -8. [License](#license) - -## Environment and Compatibility - -This sample was created using the following techologies: - -* [MariaDB X4 HTAP (v10.4)](https://github.com/mariadb-corporation/mariadb-columnstore-htap) -* [React.js (v.16.12.0)](https://github.com/facebook/react/blob/master/CHANGELOG.md#16120-november-14-2019) -* [Node.js (v.12.x)](https://nodejs.org/docs/latest-v12.x/api/index.html) -* [NPM (v.6.11.3)](https://docs.npmjs.com/) - -This sample was tested on macOS v.10.14.6. - -## Overview - -### Introduction to MariaDB - -[MariaDB platform](https://mariadb.com/products/mariadb-platform/) unifies [transactional](https://mariadb.com/products/mariadb-platform-transactional/) and [analytical](https://mariadb.com/products/mariadb-platform-analytical/) information so applications can leverage powerful, real-time analytics in order to provide data-driven customers with more information, actionable insight and greater value. - -- - - -
- -### Deploying MariaDB Hybrid Transactional-Analytical Processing (HTAP) - -MariaDB Platform supports [Hybrid Transactional-Analytical Processing (HTAP)](https://mariadb.com/docs/deploy/htap/) through a combination of MariaDB Enterprise Server, MariaDB ColumnStore, and MariaDB MaxScale. - -Here's a simple architecture diagram of MariaDB X4 Platform. - -- - - -
- -For this application we'll be targeting a single instance of MariaDB HTAP, and instructions for setting such an environment can be found here: - -https://github.com/mariadb-corporation/mariadb-columnstore-htap - -Once you have created your HTAP instance you will be able to create the schemas and load the data. If you have elected to use the method above you simply need to use - -``` -$ vagrant ssh node1 -``` - -to access the database instance. - -**Note:** You can also find more details on how to *manually* deploy MariaDB X4 [here](https://mariadb.com/docs/deploy/htap/). - -### Clone repo - -Next `git clone` this repository to the machine that contains your database instance, and then proceed to the following steps for retrieving flight data, creating schemas, and loading airports/airlines/flight data. - -### Retrieving flight data - -This application uses flight record data provided by the [Bureau of Transportation](https://www.bts.gov/). - -The following script will retrieve the data set by year and month creating CSV data files under the data directory. By default the script will retrieve data for all months from 1990 to 2020. The script can be edited to retrieve smaller or larger data ranges as needed: - -``` -$ ./get_flight_data.sh - -2018-011 - % Total % Received % Xferd Average Speed Time Time Time Current - Dload Upload Total Spent Left Speed -100 654 100 183 100 471 12 33 0:00:15 0:00:14 0:00:01 0 -100 14.9M 100 14.9M 0 0 415k 0 0:00:36 0:00:36 --:--:-- 736k -Archive: data.zip - inflating: 544122566_.csv -2018-02 -``` - -**Note:** The script makes use of curl and unzip which may need to be installed if not already present on your Linux OS. - -### Create the schema - -The following script will create (and drop if it already exists) the flights database: - -``` -$ ./create_schemas.sh -``` - -This includes the following 6 tables within the schema `innodb_schema`: - - * airlines - * airports - * flights - * tickets - * trips - - This also includes the following table within the schema `columnstore_schema`: - - * flights - -### Loading Flights data into ColumnStore - -The airlines and airports table can be populated from the airlines.csv and airports.csv files in the schema directory. Use the following script to do this: - -``` -$ ./load_airports_airlines.sh -``` - -The flights table is populated using a script which will load each CSV file from the data directory into the flights table: - -``` -$ ./load_flight_data.sh -``` - -### Setting up HTAP Replication - -Using MariaDB Replication, MariaDB Enterprise Server replicates writes from InnoDB tables to the MariaDB ColumnStore tables, ensuring that the application can perform analytical processing on current data. Combining MariaDB Replication with MariaDB MaxScale configured as a Binlog Server, MariaDB Enterprise Server can host InnoDB and ColumnStore on the same Server. - -This application uses replication on a single table called `flights`, which exists `innodb_schema` and `columnstore_schema`. In order to set up replication add the following to `/etc/maxscale.cnf` for your HTAP instance. - -``` -[replication-filter] -type = filter -module = binlogfilter -match = /[.]flights/ -rewrite_src = innodb -rewrite_dest = columnstore -``` - -For more information on configuring MariaDB HTAP please review the official [Enterprise Documentation](https://mariadb.com/docs/deploy/htap/#maxscale-configuration). - -## Requirements to run the app - -This project assumes you have familiarity with building web applications using [ReactJS](https://reactjs.org) and [NodeJS](https://nodejs.org) technologies. - -The following is required to run this application: - -1. [Download and install MariaDB HTAP](#installation). -2. [Download and install NodeJS](https://nodejs.org/en/download/). -3. 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 - -## Getting started with the app - -### Grab the code - -Download this code directly or use [git](http://www.git-scm.org) (through CLI or a client) to retrieve the code. - -### Configure the code - -Configure the MariaDB connection by [adding an .env file to the Node.js project](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#security-consideration). - -Example implementation: - -``` -DB_HOST=- - - -
- -2. Run the command: - -```bash -npm start -``` - -- - - -
- -3. Open a browser window and navigate to http://localhost:3000. - -- - - -
- -### Adding app data - -**Upcoming flight data** - -Upon running the application you will notice that searching for flights and viewin upcoming trips yields no results. This is because there currently no transactional flights, tickets, or trips data. Because this application is merely meant for demonstration purposes only you will need to provide *relevant* data within the following: - -* innodb_schema.flights -* innodb_schema.tickets -* innodb_schema.trips - -The following are sample datasets for: - -An upcoming flight (option) from LAX to ORD on February 5th, 2020. - -```sql -INSERT INTO `flights` (`year`, `month`, `day`, `day_of_week`, `fl_date`, `carrier`, `tail_num`, `fl_num`, `origin`, `dest`, `crs_dep_time`, `dep_time`, `dep_delay`, `taxi_out`, `wheels_off`, `wheels_on`, `taxi_in`, `crs_arr_time`, `arr_time`, `arr_delay`, `cancelled`, `cancellation_code`, `diverted`, `crs_elapsed_time`, `actual_elapsed_time`, `air_time`, `distance`, `carrier_delay`, `weather_delay`, `nas_delay`, `security_delay`, `late_aircraft_delay`) VALUES (2020, 2, 5, 5, '2020-02-05', 'DL', NULL, 1280, 'LAX', 'ORD', '0600', '0600', NULL, NULL, NULL, NULL, NULL, '0913', '0913', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO `tickets` (`id`, `fl_date`, `fl_num`, `carrier`, `origin`, `dest`, `price`) VALUES (1, '2020-02-05', 1280, 'DL', 'LAX', 'ORD', 240.00); -``` - -An upcoming trip from ORD to LAX on February 6th, 2020. - -```sql -INSERT INTO `flights` (`year`, `month`, `day`, `day_of_week`, `fl_date`, `carrier`, `tail_num`, `fl_num`, `origin`, `dest`, `crs_dep_time`, `dep_time`, `dep_delay`, `taxi_out`, `wheels_off`, `wheels_on`, `taxi_in`, `crs_arr_time`, `arr_time`, `arr_delay`, `cancelled`, `cancellation_code`, `diverted`, `crs_elapsed_time`, `actual_elapsed_time`, `air_time`, `distance`, `carrier_delay`, `weather_delay`, `nas_delay`, `security_delay`, `late_aircraft_delay`) VALUES (2020, 2, 6, 2, '2020-02-06', 'DL', NULL, 1170, 'ORD', 'LAX', '1420', '1420', NULL, NULL, NULL, NULL, NULL, '1730', '1730', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO `tickets` (`id`, `fl_date`, `fl_num`, `carrier`, `origin`, `dest`, `price`) VALUES (2, '2020-02-06', 1170, 'DL', 'ORD', 'LAX', 276.00); - -INSERT INTO `trips` (`id`, `ticket_id`) VALUES (1, 2); -``` - -**Weather forecast data** - -You also have the option of hard-coding your weather forecast information or integrating a Weather Forecast API of your choice. Currently the data is hard-coded, but can facilitate either approach. - -Check out [tripRoutes.js](https://github.com/mariadb-corporation/Developer-Examples/blob/master/Bookings/src/routes/tripsRoutes.js#L105-L122) to learn more. - -```js -var forecasts = { - "ORD_2020-02-06": { - description: "Snow", - icon: "snow", - temp_low: "28°F", - temp_high: "29°F", - precip_probability: 0.6, - wind_speed: 15 - }, - "LAX_2020-02-08": { - description: "Clear", - icon: "clear-day", - temp_low: "56°F", - temp_high: "65°F", - precip_probability: 0, - wind_speed: 5 - } -}; -``` - -## Smart Transactions - -At this point you're probably wondering, what are smart transactions? - -At their core, smart transactions are the standard transactions that databases have been performing for decades – ultimately powering the online interactions we’ve become accustomed to. The difference with modern applications is the use of real-time analytics before, during and/or after these transactions. - -**Pre-transaction** - -This application uses real-time analytics before a flight is booked. Each flight ticket option contains information calculated from the historical records (average delay, average duration, flight score, etc.) within the `flights` table. - -- - - -
- -- - - -
- -**Post-transaction** - -This application also uses real-time analytics after a flight has been booked, and a trip has been created. - -- - - -
- -## Cross-Engine Queries - -This application uses cross-engine queries to maximize the potentials of the MariaDB X4 Platform. Cross-engine querying is the ability to access, via MaxScale, both the transactional and analytics data within a single query. - -- - - -
- -## Support and Contribution - -Thanks so much for taking a look at the Bookings app! As this is a very simple example, there's plenty of potential for customization. Please feel free to submit PR's to the project to include your modifications! - -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/bookings/create_flights_tickets.sh b/bookings/create_flights_tickets.sh deleted file mode 100755 index 8bfa40d..0000000 --- a/bookings/create_flights_tickets.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -target_year=$1 -source_year=$2 -month=$3 - -MariaDB="mariadb -h10.10.10.11 -udba -pDemo_password1 innodb_schema -e" - -${MariaDB} "INSERT INTO innodb_schema.flights (year,month,day,fl_date,carrier,fl_num,origin,dest,dep_time,arr_time,distance) SELECT $target_year,month,day,(concat($target_year,'-',month,'-',day)),carrier,fl_num,origin,dest,dep_time,arr_time,distance from columnstore_schema.flights where (year=$source_year and month=$month);" - -${MariaDB} "DELETE FROM innodb_schema.tickets;" - -${MariaDB} "INSERT INTO innodb_schema.tickets (fl_date,fl_num,carrier,origin,dest,price) SELECT fl_date,fl_num,carrier,origin,dest,distance*((FLOOR(RAND()*(75-55+1))+55)/100) FROM innodb_schema.flights;" - - diff --git a/bookings/create_schemas.sh b/bookings/create_schemas.sh deleted file mode 100644 index 7eb03c7..0000000 --- a/bookings/create_schemas.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -SCHEMA_DIR=$(readlink -f ./schema) - -# create innodbtables: airports, airlines -/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -vvv < $SCHEMA_DIR/idb_schema.sql -# create columnstore table: flights -/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -vvv < $SCHEMA_DIR/cs_schema.sql diff --git a/bookings/get_flight_data.sh b/bookings/get_flight_data.sh deleted file mode 100644 index 36f71d7..0000000 --- a/bookings/get_flight_data.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# This script will remotely invoke the bureau of transportation statistics web form to retrieve data by month: -# https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time -# for the specific columns listed in the SQL and utilized by the sample schema. -mkdir -p data -for y in {1990..2020}; do - for m in {1..12}; do - yyyymm="$y-$(printf %02d $m)" - echo "$yyyymm" - curl -L -o data.zip -d "sqlstr=+SELECT+YEAR%2CMONTH%2CDAY_OF_MONTH%2CDAY_OF_WEEK%2CFL_DATE%2CCARRIER%2CTAIL_NUM%2CFL_NUM%2CORIGIN%2CDEST%2CCRS_DEP_TIME%2CDEP_TIME%2CDEP_DELAY%2CTAXI_OUT%2CWHEELS_OFF%2CWHEELS_ON%2CTAXI_IN%2CCRS_ARR_TIME%2CARR_TIME%2CARR_DELAY%2CCANCELLED%2CCANCELLATION_CODE%2CDIVERTED%2CCRS_ELAPSED_TIME%2CACTUAL_ELAPSED_TIME%2CAIR_TIME%2CDISTANCE%2CCARRIER_DELAY%2CWEATHER_DELAY%2CNAS_DELAY%2CSECURITY_DELAY%2CLATE_AIRCRAFT_DELAY+FROM++T_ONTIME+WHERE+Month+%3D$m+AND+YEAR%3D$y" https://www.transtats.bts.gov/DownLoad_Table.asp?Table_ID=236 - rm -f *.csv - unzip data.zip - rm -f data.zip - mv *.csv $yyyymm.csv - tail -n +2 $yyyymm.csv > data/$yyyymm.csv - rm -f $yyyymm.csv - done -done \ No newline at end of file diff --git a/bookings/load_airports_airlines.sh b/bookings/load_airports_airlines.sh deleted file mode 100644 index 07ea6be..0000000 --- a/bookings/load_airports_airlines.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -SCHEMA_DIR=$(readlink -f ./schema) - -# use the csv's to load data into the airports and airlines tables -#/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/idb_load_data.sql -/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -e "LOAD DATA INFILE '${SCHEMA_DIR}/airports.csv' INTO TABLE innodb_schema.airports FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n';" -/usr/bin/mysql -udba -pDemo_password1 -h10.10.10.10 -e "LOAD DATA INFILE '${SCHEMA_DIR}/airlines.csv' INTO TABLE innodb_schema.airlines FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n';" diff --git a/bookings/load_flights_data.sh b/bookings/load_flights_data.sh deleted file mode 100644 index a232d22..0000000 --- a/bookings/load_flights_data.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# check for argument, if so use as wildcard for file load match, otherwise load everything -DATA_DIR=$(readlink -f ./data) -filematch="*" -if [ $# -eq 1 ] -then - filematch="*$1*" -fi -# load the specified files under the data directory with the file pattern match -# here we use cpimport mode 2 to force processing at each PM node which has -# the advantage of this being runnable as a regular user with a root installation. -for f in $DATA_DIR/$filematch.csv; do - echo $f - /usr/bin/cpimport -m2 -s ',' -E '"' columnstore_schema flights -l $f -done diff --git a/bookings/media/cli_root.png b/bookings/media/cli_root.png deleted file mode 100644 index 362c270..0000000 Binary files a/bookings/media/cli_root.png and /dev/null differ diff --git a/bookings/media/cross_engine.png b/bookings/media/cross_engine.png deleted file mode 100644 index 10190b3..0000000 Binary files a/bookings/media/cross_engine.png and /dev/null differ diff --git a/bookings/media/demo.gif b/bookings/media/demo.gif deleted file mode 100644 index f2f6c57..0000000 Binary files a/bookings/media/demo.gif and /dev/null differ diff --git a/bookings/media/flight_1.png b/bookings/media/flight_1.png deleted file mode 100644 index f0a608c..0000000 Binary files a/bookings/media/flight_1.png and /dev/null differ diff --git a/bookings/media/flight_2.png b/bookings/media/flight_2.png deleted file mode 100644 index 0bcba7a..0000000 Binary files a/bookings/media/flight_2.png and /dev/null differ diff --git a/bookings/media/get_started.png b/bookings/media/get_started.png deleted file mode 100644 index ff41989..0000000 Binary files a/bookings/media/get_started.png and /dev/null differ diff --git a/bookings/media/npm_start.png b/bookings/media/npm_start.png deleted file mode 100644 index 9cae92c..0000000 Binary files a/bookings/media/npm_start.png and /dev/null differ diff --git a/bookings/media/platform.png b/bookings/media/platform.png deleted file mode 100644 index bf5638d..0000000 Binary files a/bookings/media/platform.png and /dev/null differ diff --git a/bookings/media/trip_1.png b/bookings/media/trip_1.png deleted file mode 100644 index bdf2310..0000000 Binary files a/bookings/media/trip_1.png and /dev/null differ diff --git a/bookings/media/x4.png b/bookings/media/x4.png deleted file mode 100644 index be6122a..0000000 Binary files a/bookings/media/x4.png and /dev/null differ diff --git a/bookings/schema/airlines.csv b/bookings/schema/airlines.csv deleted file mode 100755 index 0806e94..0000000 --- a/bookings/schema/airlines.csv +++ /dev/null @@ -1,17 +0,0 @@ -UA,United Air Lines Inc. -AA,American Airlines Inc. -US,US Airways Inc. -F9,Frontier Airlines Inc. -B6,JetBlue Airways -OO,Skywest Airlines Inc. -AS,Alaska Airlines Inc. -NK,Spirit Air Lines -WN,Southwest Airlines Co. -DL,Delta Air Lines Inc. -EV,ExpressJet -HA,Hawaiian Airlines Inc. -MQ,American Eagle Airlines Inc. -VX,Virgin America -9E,Endeavor Air -FL,AirTran Airways Inc. -YV,Mesa Airlines Inc diff --git a/bookings/schema/airports.csv b/bookings/schema/airports.csv deleted file mode 100755 index 4bf01a0..0000000 --- a/bookings/schema/airports.csv +++ /dev/null @@ -1,342 +0,0 @@ -ABE,Lehigh Valley International Airport,Allentown,PA,USA,40.65236,-75.44040 -ABI,Abilene Regional Airport,Abilene,TX,USA,32.41132,-99.68190 -ABQ,Albuquerque International Sunport,Albuquerque,NM,USA,35.04022,-106.60919 -ABR,Aberdeen Regional Airport,Aberdeen,SD,USA,45.44906,-98.42183 -ABY,Southwest Georgia Regional Airport,Albany,GA,USA,31.53552,-84.19447 -ACK,Nantucket Memorial Airport,Nantucket,MA,USA,41.25305,-70.06018 -ACT,Waco Regional Airport,Waco,TX,USA,31.61129,-97.23052 -ACV,Arcata Airport,Arcata/Eureka,CA,USA,40.97812,-124.10862 -ACY,Atlantic City International Airport,Atlantic City,NJ,USA,39.45758,-74.57717 -ADK,Adak Airport,Adak,AK,USA,51.87796,-176.64603 -ADQ,Kodiak Airport,Kodiak,AK,USA,57.74997,-152.49386 -AEX,Alexandria International Airport,Alexandria,LA,USA,31.32737,-92.54856 -AGS,Augusta Regional Airport (Bush Field),Augusta,GA,USA,33.36996,-81.96450 -AKN,King Salmon Airport,King Salmon,AK,USA,58.67680,-156.64922 -ALB,Albany International Airport,Albany,NY,USA,42.74812,-73.80298 -ALO,Waterloo Regional Airport,Waterloo,IA,USA,42.55708,-92.40034 -AMA,Rick Husband Amarillo International Airport,Amarillo,TX,USA,35.21937,-101.70593 -ANC,Ted Stevens Anchorage International Airport,Anchorage,AK,USA,61.17432,-149.99619 -APN,Alpena County Regional Airport,Alpena,MI,USA,45.07807,-83.56029 -ASE,Aspen-Pitkin County Airport,Aspen,CO,USA,39.22316,-106.86885 -ATL,Hartsfield-Jackson Atlanta International Airport,Atlanta,GA,USA,33.64044,-84.42694 -ATW,Appleton International Airport,Appleton,WI,USA,44.25741,-88.51948 -AUS,Austin-Bergstrom International Airport,Austin,TX,USA,30.19453,-97.66987 -AVL,Asheville Regional Airport,Asheville,NC,USA,35.43619,-82.54181 -AVP,Wilkes-Barre/Scranton International Airport,Wilkes-Barre/Scranton,PA,USA,41.33815,-75.72427 -AZO,Kalamazoo/Battle Creek International Airport,Kalamazoo,MI,USA,42.23488,-85.55206 -BDL,Bradley International Airport,Windsor Locks,CT,USA,41.93887,-72.68323 -BET,Bethel Airport,Bethel,AK,USA,60.77978,-161.83800 -BFL,Meadows Field,Bakersfield,CA,USA,35.43360,-119.05677 -BGM,Greater Binghamton Airport,Binghamton,NY,USA,42.20848,-75.97961 -BGR,Bangor International Airport,Bangor,ME,USA,44.80744,-68.82814 -BHM,Birmingham-Shuttlesworth International Airport,Birmingham,AL,USA,33.56294,-86.75355 -BIL,Billings Logan International Airport,Billings,MT,USA,45.80766,-108.54286 -BIS,Bismarck Municipal Airport,Bismarck,ND,USA,46.77411,-100.74672 -BJI,Bemidji Regional Airport,Bemidji,MN,USA,47.50942,-94.93372 -BLI,Bellingham International Airport,Bellingham,WA,USA,48.79275,-122.53753 -BMI,Central Illinois Regional Airport at Bloomington-Normal,Bloomington,IL,USA,40.47799,-88.91595 -BNA,Nashville International Airport,Nashville,TN,USA,36.12448,-86.67818 -BOI,Boise Airport (Boise Air Terminal),Boise,ID,USA,43.56444,-116.22278 -BOS,Gen. Edward Lawrence Logan International Airport,Boston,MA,USA,42.36435,-71.00518 -BPT,Jack Brooks Regional Airport (Southeast Texas Regional),Beaumont/Port Arthur,TX,USA,29.95083,-94.02069 -BQK,Brunswick Golden Isles Airport,Brunswick,GA,USA,31.25903,-81.46631 -BQN,Rafael Hernández Airport,Aguadilla,PR,USA,18.49486,-67.12944 -BRD,Brainerd Lakes Regional Airport,Brainerd,MN,USA,46.39786,-94.13723 -BRO,Brownsville/South Padre Island International Airport,Brownsville,TX,USA,25.90683,-97.42586 -BRW,Wiley Post-Will Rogers Memorial Airport,Barrow,AK,USA,71.28545,-156.76600 -BTM,Bert Mooney Airport,Butte,MT,USA,45.95480,-112.49746 -BTR,Baton Rouge Metropolitan Airport,Baton Rouge,LA,USA,30.53316,-91.14963 -BTV,Burlington International Airport,Burlington,VT,USA,44.47300,-73.15031 -BUF,Buffalo Niagara International Airport,Buffalo,NY,USA,42.94052,-78.73217 -BUR,Bob Hope Airport (Hollywood Burbank Airport),Burbank,CA,USA,34.20062,-118.35850 -BWI,Baltimore-Washington International Airport,Baltimore,MD,USA,39.17540,-76.66820 -BZN,Bozeman Yellowstone International Airport (Gallatin Field Airport),Bozeman,MT,USA,45.77690,-111.15301 -CAE,Columbia Metropolitan Airport,Columbia,SC,USA,33.93884,-81.11954 -CAK,Akron-Canton Regional Airport,Akron,OH,USA,40.91631,-81.44247 -CDC,Cedar City Regional Airport,Cedar City,UT,USA,37.70097,-113.09858 -CDV,Merle K. (Mudhole) Smith Airport,Cordova,AK,USA,60.49183,-145.47765 -CEC,Del Norte County Airport (Jack McNamara Field),Crescent City,CA,USA,41.78016,-124.23653 -CHA,Chattanooga Metropolitan Airport (Lovell Field),Chattanooga,TN,USA,35.03527,-85.20379 -CHO,Charlottesville-Albemarle Airport,Charlottesville,VA,USA,38.13864,-78.45286 -CHS,Charleston International Airport/Charleston AFB,Charleston,SC,USA,32.89865,-80.04051 -CID,The Eastern Iowa Airport,Cedar Rapids,IA,USA,41.88459,-91.71087 -CIU,Chippewa County International Airport,Sault Ste. Marie,MI,USA,46.25075,-84.47239 -CLD,McClellan-Palomar Airport,San Diego,CA,USA,33.12723,-117.27873 -CLE,Cleveland Hopkins International Airport,Cleveland,OH,USA,41.41089,-81.84940 -CLL,Easterwood Airport,College Station,TX,USA,30.58859,-96.36382 -CLT,Charlotte Douglas International Airport,Charlotte,NC,USA,35.21401,-80.94313 -CMH,Port Columbus International Airport,Columbus,OH,USA,39.99799,-82.89188 -CMI,University of Illinois - Willard Airport,Champaign/Urbana,IL,USA,40.03925,-88.27806 -CMX,Houghton County Memorial Airport,Hancock,MI,USA,47.16842,-88.48906 -CNY,Canyonlands Field,Moab,UT,USA,38.75496,-109.75484 -COD,Yellowstone Regional Airport,Cody,WY,USA,44.52019,-109.02380 -COS,City of Colorado Springs Municipal Airport,Colorado Springs,CO,USA,38.80581,-104.70025 -COU,Columbia Regional Airport,Columbia,MO,USA,38.81809,-92.21963 -CPR,Natrona County International Airport,Casper,WY,USA,42.90836,-106.46447 -CRP,Corpus Christi International Airport,Corpus Christi,TX,USA,27.77036,-97.50122 -CRW,Yeager Airport,Charleston,WV,USA,38.37315,-81.59319 -CSG,Columbus Metropolitan Airport,Columbus,GA,USA,32.51633,-84.93886 -CVG,Cincinnati/Northern Kentucky International Airport,Covington,KY,USA,39.04614,-84.66217 -CWA,Central Wisconsin Airport,Mosinee,WI,USA,44.77762,-89.66678 -DAB,Daytona Beach International Airport,Daytona Beach,FL,USA,29.17992,-81.05806 -DAL,Dallas Love Field,Dallas,TX,USA,32.84711,-96.85177 -DAY,James M. Cox Dayton International Airport,Dayton,OH,USA,39.90238,-84.21938 -DBQ,Dubuque Regional Airport,Dubuque,IA,USA,42.40296,-90.70917 -DCA,Ronald Reagan Washington National Airport,Arlington,VA,USA,38.85208,-77.03772 -DEN,Denver International Airport,Denver,CO,USA,39.85841,-104.66700 -DFW,Dallas/Fort Worth International Airport,Dallas-Fort Worth,TX,USA,32.89595,-97.03720 -DHN,Dothan Regional Airport,Dothan,AL,USA,31.32134,-85.44963 -DIK,Dickinson Theodore Roosevelt Regional Airport,Dickinson,ND,USA,46.79739,-102.80195 -DLG,Dillingham Airport,Dillingham,AK,USA,59.04541,-158.50334 -DLH,Duluth International Airport,Duluth,MN,USA,46.84209,-92.19365 -DRO,Durango-La Plata County Airport,Durango,CO,USA,37.15152,-107.75377 -DSM,Des Moines International Airport,Des Moines,IA,USA,41.53493,-93.66068 -DTW,Detroit Metropolitan Airport,Detroit,MI,USA,42.21206,-83.34884 -DVL,Devils Lake Regional Airport,Devils Lake,ND,USA,48.11425,-98.90878 -EAU,Chippewa Valley Regional Airport,Eau Claire,WI,USA,44.86526,-91.48507 -ECP,Northwest Florida Beaches International Airport,Panama City,FL,USA,, -EGE,Eagle County Regional Airport,Eagle,CO,USA,39.64257,-106.91770 -EKO,Elko Regional Airport,Elko,NV,USA,40.82493,-115.79170 -ELM,Elmira/Corning Regional Airport,Elmira,NY,USA,42.15991,-76.89144 -ELP,El Paso International Airport,El Paso,TX,USA,31.80667,-106.37781 -ERI,Erie International Airport,Erie,PA,USA,42.08202,-80.17622 -ESC,Delta County Airport,Escanaba,MI,USA,45.72267,-87.09373 -EUG,Eugene Airport (Mahlon Sweet Field),Eugene,OR,USA,44.12326,-123.21869 -EVV,Evansville Regional Airport,Evansville,IN,USA,38.03799,-87.53063 -EWN,Coastal Carolina Regional Airport (Craven County Regional),New Bern,NC,USA,35.07297,-77.04294 -EWR,Newark Liberty International Airport,Newark,NJ,USA,40.69250,-74.16866 -EYW,Key West International Airport,Key West,FL,USA,24.55611,-81.75956 -FAI,Fairbanks International Airport,Fairbanks,AK,USA,64.81368,-147.85967 -FAR,Hector International Airport,Fargo,ND,USA,46.91935,-96.81499 -FAT,Fresno Yosemite International Airport,Fresno,CA,USA,36.77619,-119.71814 -FAY,Fayetteville Regional Airport,Fayetteville,NC,USA,34.99147,-78.88000 -FCA,Glacier Park International Airport,Kalispell,MT,USA,48.31140,-114.25507 -FLG,Flagstaff Pulliam Airport,Flagstaff,AZ,USA,35.13845,-111.67122 -FLL,Fort Lauderdale-Hollywood International Airport,Ft. Lauderdale,FL,USA,26.07258,-80.15275 -FNT,Bishop International Airport,Flint,MI,USA,42.96550,-83.74346 -FSD,Sioux Falls Regional Airport,Sioux Falls,SD,USA,43.58135,-96.74170 -FSM,Fort Smith Regional Airport,Fort Smith,AR,USA,35.33659,-94.36744 -FWA,Fort Wayne International Airport,Fort Wayne,IN,USA,40.97847,-85.19515 -GCC,Gillette-Campbell County Airport,Gillette,WY,USA,44.34890,-105.53936 -GCK,Garden City Regional Airport,Garden City,KS,USA,37.92752,-100.72441 -GEG,Spokane International Airport,Spokane,WA,USA,47.61986,-117.53384 -GFK,Grand Forks International Airport,Grand Forks,ND,USA,47.94926,-97.17611 -GGG,East Texas Regional Airport,Longview,TX,USA,32.38486,-94.71171 -GJT,Grand Junction Regional Airport (Walker Field),Grand Junction,CO,USA,39.12241,-108.52673 -GNV,Gainesville Regional Airport,Gainesville,FL,USA,29.69006,-82.27178 -GPT,Gulfport-Biloxi International Airport,Gulfport-Biloxi,MS,USA,30.40728,-89.07009 -GRB,Green Bay-Austin Straubel International Airport,Green Bay,WI,USA,44.48507,-88.12959 -GRI,Central Nebraska Regional Airport,Grand Island,NE,USA,40.96747,-98.30861 -GRK,Killeen-Fort Hood Regional Airport,Killeen,TX,USA,31.06490,-97.82780 -GRR,Gerald R. Ford International Airport,Grand Rapids,MI,USA,42.88082,-85.52277 -GSO,Piedmont Triad International Airport,Greensboro,NC,USA,36.09775,-79.93730 -GSP,Greenville-Spartanburg International Airport,Greer,SC,USA,34.89567,-82.21886 -GST,Gustavus Airport,Gustavus,AK,USA,58.42438,-135.70738 -GTF,Great Falls International Airport,Great Falls,MT,USA,47.48200,-111.37069 -GTR,Golden Triangle Regional Airport,Columbus-Starkville-West Point,MS,USA,33.45033,-88.59137 -GUC,Gunnison-Crested Butte Regional Airport,Gunnison,CO,USA,38.53396,-106.93318 -GUM,Guam International Airport,Agana,GU,USA,13.48345,-144.79598 -HDN,Yampa Valley Airport (Yampa Valley Regional),Hayden,CO,USA,40.48118,-107.21766 -HIB,Range Regional Airport (Chisholm-Hibbing Airport),Hibbing,MN,USA,47.38660,-92.83899 -HLN,Helena Regional Airport,Helena,MT,USA,46.60682,-111.98275 -HNL,Honolulu International Airport,Honolulu,HI,USA,21.31869,-157.92241 -HOB,Lea County Regional Airport,Hobbs,NM,USA,32.68753,-103.21703 -HOU,William P. Hobby Airport,Houston,TX,USA,29.64542,-95.27889 -HPN,Westchester County Airport,White Plains,NY,USA,41.06696,-73.70757 -HRL,Valley International Airport,Harlingen,TX,USA,26.22851,-97.65439 -HSV,Huntsville International Airport,Huntsville,AL,USA,34.64045,-86.77311 -HYA,Barnstable Municipal Airport,Hyannis,MA,USA,41.66934,-70.28036 -HYS,Hays Regional Airport,Hays,KS,USA,38.84494,-99.27403 -IAD,Washington Dulles International Airport,Chantilly,VA,USA,38.94453,-77.45581 -IAG,Niagara Falls International Airport,Niagara Falls,NY,USA,43.10726,-78.94538 -IAH,George Bush Intercontinental Airport,Houston,TX,USA,29.98047,-95.33972 -ICT,Wichita Dwight D. Eisenhower National Airport (Wichita Mid-Continent Airport),Wichita,KS,USA,37.64996,-97.43305 -IDA,Idaho Falls Regional Airport,Idaho Falls,ID,USA,43.51456,-112.07017 -ILG,Wilmington Airport,Wilmington,DE,USA,39.67872,-75.60653 -ILM,Wilmington International Airport,Wilmington,NC,USA,34.27061,-77.90256 -IMT,Ford Airport,Iron Mountain/Kingsford,MI,USA,45.81835,-88.11454 -IND,Indianapolis International Airport,Indianapolis,IN,USA,39.71733,-86.29438 -INL,Falls International Airport,International Falls,MN,USA,48.56619,-93.40307 -ISN,Sloulin Field International Airport,Williston,ND,USA,48.17794,-103.64235 -ISP,Long Island MacArthur Airport,Islip,NY,USA,40.79524,-73.10021 -ITH,Ithaca Tompkins Regional Airport,Ithaca,NY,USA,42.49103,-76.45844 -ITO,Hilo International Airport,Hilo,HI,USA,19.72026,-155.04847 -JAC,Jackson Hole Airport,Jackson,WY,USA,43.60732,-110.73774 -JAN,Jackson-Evers International Airport,Jackson,MS,USA,32.31117,-90.07589 -JAX,Jacksonville International Airport,Jacksonville,FL,USA,30.49406,-81.68786 -JFK,John F. Kennedy International Airport (New York International Airport),New York,NY,USA,40.63975,-73.77893 -JLN,Joplin Regional Airport,Joplin,MO,USA,37.15181,-94.49827 -JMS,Jamestown Regional Airport,Jamestown,ND,USA,46.92972,-98.67820 -JNU,Juneau International Airport,Juneau,AK,USA,58.35496,-134.57628 -KOA,Kona International Airport at Keahole,Kailua/Kona,HI,USA,19.73877,-156.04563 -KTN,Ketchikan International Airport,Ketchikan,AK,USA,55.35557,-131.71374 -LAN,Capital Region International Airport ( Lansing Capital City),Lansing,MI,USA,42.77870,-84.58736 -LAR,Laramie Regional Airport,Laramie,WY,USA,41.31205,-105.67499 -LAS,McCarran International Airport,Las Vegas,NV,USA,36.08036,-115.15233 -LAW,Lawton-Fort Sill Regional Airport,Lawton,OK,USA,34.56771,-98.41664 -LAX,Los Angeles International Airport,Los Angeles,CA,USA,33.94254,-118.40807 -LBB,Lubbock Preston Smith International Airport,Lubbock,TX,USA,33.66364,-101.82278 -LBE,Arnold Palmer Regional Airport,Latrobe,PA,USA,40.27594,-79.40480 -LCH,Lake Charles Regional Airport,Lake Charles,LA,USA,30.12610,-93.22340 -LEX,Blue Grass Airport,Lexington,KY,USA,38.03697,-84.60539 -LFT,Lafayette Regional Airport,Lafayette,LA,USA,30.20528,-91.98766 -LGA,LaGuardia Airport (Marine Air Terminal),New York,NY,USA,40.77724,-73.87261 -LGB,Long Beach Airport (Daugherty Field),Long Beach,CA,USA,33.81772,-118.15161 -LIH,Lihue Airport,Lihue,HI,USA,21.97598,-159.33896 -LIT,Bill and Hillary Clinton National Airport (Adams Field),Little Rock,AR,USA,34.72940,-92.22425 -LNK,Lincoln Airport (Lincoln Municipal),Lincoln,NE,USA,40.85097,-96.75925 -LRD,Laredo International Airport,Laredo,TX,USA,27.54374,-99.46154 -LSE,La Crosse Regional Airport,La Crosse,WI,USA,43.87938,-91.25654 -LWS,Lewiston-Nez Perce County Airport,Lewiston,ID,USA,46.37450,-117.01539 -MAF,Midland International Airport,Midland,TX,USA,31.94253,-102.20191 -MBS,MBS International Airport,Saginaw,MI,USA,43.53291,-84.07965 -MCI,Kansas City International Airport,Kansas City,MO,USA,39.29761,-94.71391 -MCO,Orlando International Airport,Orlando,FL,USA,28.42889,-81.31603 -MDT,Harrisburg International Airport,Harrisburg,PA,USA,40.19350,-76.76340 -MDW,Chicago Midway International Airport,Chicago,IL,USA,41.78598,-87.75242 -MEI,Meridian Regional Airport,Meridian,MS,USA,32.33313,-88.75121 -MEM,Memphis International Airport,Memphis,TN,USA,35.04242,-89.97667 -MFE,McAllen-Miller International Airport (McAllen Miller International),McAllen,TX,USA,26.17583,-98.23861 -MFR,Rogue Valley International Airport,Medford,OR,USA,42.37423,-122.87350 -MGM,Montgomery Regional Airport,Montgomery,AL,USA,32.30064,-86.39398 -MHK,Manhattan Regional Airport,Manhattan,KS,USA,39.14097,-96.67083 -MHT,Manchester-Boston Regional Airport,Manchester,NH,USA,42.93452,-71.43706 -MIA,Miami International Airport,Miami,FL,USA,25.79325,-80.29056 -MKE,General Mitchell International Airport,Milwaukee,WI,USA,42.94722,-87.89658 -MKG,Muskegon County Airport,Muskegon,MI,USA,43.16949,-86.23822 -MLB,Melbourne International Airport,Melbourne,FL,USA,28.10275,-80.64581 -MLI,Quad City International Airport,Moline,IL,USA,41.44853,-90.50754 -MLU,Monroe Regional Airport,Monroe,LA,USA,32.51087,-92.03769 -MMH,Mammoth Yosemite Airport,Mammoth Lakes,CA,USA,37.62405,-118.83777 -MOB,Mobile Regional Airport,Mobile,AL,USA,30.69142,-88.24283 -MOT,Minot International Airport,Minot,ND,USA,48.25938,-101.28033 -MQT,Sawyer International Airport,Marquette,MI,USA,46.35364,-87.39536 -MRY,Monterey Regional Airport (Monterey Peninsula Airport),Monterey,CA,USA,36.58698,-121.84295 -MSN,Dane County Regional Airport,Madison,WI,USA,43.13986,-89.33751 -MSO,Missoula International Airport,Missoula,MT,USA,46.91631,-114.09056 -MSP,Minneapolis-Saint Paul International Airport,Minneapolis,MN,USA,44.88055,-93.21692 -MSY,Louis Armstrong New Orleans International Airport,New Orleans,LA,USA,29.99339,-90.25803 -MTJ,Montrose Regional Airport,Montrose,CO,USA,38.50887,-107.89383 -MVY,Martha's Vineyard Airport,Marthas Vineyard,MA,USA,41.39303,-70.61433 -MYR,Myrtle Beach International Airport,Myrtle Beach,SC,USA,33.67975,-78.92833 -OAJ,Albert J. Ellis Airport,Jacksonville,NC,USA,34.82916,-77.61214 -OAK,Oakland International Airport,Oakland,CA,USA,37.72129,-122.22072 -OGG,Kahului Airport,Kahului,HI,USA,20.89865,-156.43046 -OKC,Will Rogers World Airport,Oklahoma City,OK,USA,35.39309,-97.60073 -OMA,Eppley Airfield,Omaha,NE,USA,41.30252,-95.89417 -OME,Nome Airport,Nome,AK,USA,64.51220,-165.44525 -ONT,Ontario International Airport,Ontario,CA,USA,34.05600,-117.60119 -ORD,Chicago O'Hare International Airport,Chicago,IL,USA,41.97960,-87.90446 -ORF,Norfolk International Airport,Norfolk,VA,USA,36.89461,-76.20122 -ORH,Worcester Regional Airport,Worcester,MA,USA,42.26734,-71.87571 -OTH,Southwest Oregon Regional Airport (North Bend Municipal),North Bend,OR,USA,43.41714,-124.24603 -OTZ,Ralph Wien Memorial Airport,Kotzebue,AK,USA,66.88468,-162.59855 -PAH,Barkley Regional Airport,Paducah,KY,USA,37.06083,-88.77375 -PBG,Plattsburgh International Airport,Plattsburgh,NY,USA,, -PBI,Palm Beach International Airport,West Palm Beach,FL,USA,26.68316,-80.09559 -PDX,Portland International Airport,Portland,OR,USA,45.58872,-122.59750 -PHF,Newport News/Williamsburg International Airport,Newport News,VA,USA,37.13190,-76.49299 -PHL,Philadelphia International Airport,Philadelphia,PA,USA,39.87195,-75.24114 -PHX,Phoenix Sky Harbor International Airport,Phoenix,AZ,USA,33.43417,-112.00806 -PIA,General Wayne A. Downing Peoria International Airport,Peoria,IL,USA,40.66424,-89.69331 -PIB,Hattiesburg-Laurel Regional Airport,Hattiesburg-Laurel,MS,USA,31.46715,-89.33706 -PIH,Pocatello Regional Airport,Pocatello,ID,USA,42.91131,-112.59586 -PIT,Pittsburgh International Airport,Pittsburgh,PA,USA,40.49147,-80.23287 -PLN,Pellston Regional Airport of Emmet County,Pellston,MI,USA,45.57093,-84.79672 -PNS,Pensacola International Airport (Pensacola Gulf Coast Regional Airport),Pensacola,FL,USA,30.47331,-87.18744 -PPG,Pago Pago International Airport (Tafuna Airport),Pago Pago,AS,USA,14.33102,-170.71053 -PSC,Tri-Cities Airport,Pasco,WA,USA,46.26468,-119.11903 -PSE,Mercedita Airport,Ponce,PR,USA,18.00830,-66.56301 -PSG,Petersburg James A. Johnson Airport,Petersburg,AK,USA,56.80165,-132.94528 -PSP,Palm Springs International Airport,Palm Springs,CA,USA,33.82922,-116.50625 -PUB,Pueblo Memorial Airport,Pueblo,CO,USA,38.28909,-104.49657 -PVD,Theodore Francis Green State Airport,Providence,RI,USA,41.72400,-71.42822 -PWM,Portland International Jetport,Portland,ME,USA,43.64617,-70.30875 -RAP,Rapid City Regional Airport,Rapid City,SD,USA,44.04532,-103.05737 -RDD,Redding Municipal Airport,Redding,CA,USA,40.50898,-122.29340 -RDM,Redmond Municipal Airport (Roberts Field),Redmond,OR,USA,44.25407,-121.14996 -RDU,Raleigh-Durham International Airport,Raleigh,NC,USA,35.87764,-78.78747 -RHI,Rhinelander-Oneida County Airport,Rhinelander,WI,USA,45.63119,-89.46745 -RIC,Richmond International Airport,Richmond,VA,USA,37.50517,-77.31967 -RKS,Rock Springs-Sweetwater County Airport,Rock Springs,WY,USA,41.59422,-109.06519 -RNO,Reno/Tahoe International Airport,Reno,NV,USA,39.49858,-119.76806 -ROA,Roanoke Regional Airport (Woodrum Field),Roanoke,VA,USA,37.32547,-79.97543 -ROC,Greater Rochester International Airport,Rochester,NY,USA,43.11887,-77.67238 -ROW,Roswell International Air Center,Roswell,NM,USA,33.30156,-104.53056 -RST,Rochester International Airport,Rochester,MN,USA,43.90883,-92.49799 -RSW,Southwest Florida International Airport,Ft. Myers,FL,USA,26.53617,-81.75517 -SAF,Santa Fe Municipal Airport,Santa Fe,NM,USA,35.61678,-106.08814 -SAN,San Diego International Airport (Lindbergh Field),San Diego,CA,USA,32.73356,-117.18966 -SAT,San Antonio International Airport,San Antonio,TX,USA,29.53369,-98.46978 -SAV,Savannah/Hilton Head International Airport,Savannah,GA,USA,32.12758,-81.20214 -SBA,Santa Barbara Municipal Airport (Santa Barbara Airport),Santa Barbara,CA,USA,34.42621,-119.84037 -SBN,South Bend International Airport (South Bend Regional),South Bend,IN,USA,41.70895,-86.31847 -SBP,San Luis Obispo County Regional Airport (McChesney Field),San Luis Obispo,CA,USA,35.23706,-120.64239 -SCC,Deadhorse Airport (Prudhoe Bay Airport),Deadhorse,AK,USA,70.19476,-148.46516 -SCE,University Park Airport,State College,PA,USA,40.85121,-77.84630 -SDF,Louisville International Airport (Standiford Field),Louisville,KY,USA,38.17439,-85.73600 -SEA,Seattle-Tacoma International Airport,Seattle,WA,USA,47.44898,-122.30931 -SFO,San Francisco International Airport,San Francisco,CA,USA,37.61900,-122.37484 -SGF,Springfield-Branson National Airport,Springfield,MO,USA,37.24433,-93.38686 -SGU,St. George Regional Airport,St George,UT,USA,37.09058,-113.59306 -SHV,Shreveport Regional Airport,Shreveport,LA,USA,32.44663,-93.82560 -SIT,Sitka Rocky Gutierrez Airport,Sitka,AK,USA,57.04714,-135.36160 -SJC,Norman Y. Mineta San José International Airport,San Jose,CA,USA,37.36186,-121.92901 -SJT,San Angelo Regional Airport (Mathis Field),San Angelo,TX,USA,31.35775,-100.49631 -SJU,Luis Muñoz Marín International Airport,San Juan,PR,USA,18.43942,-66.00183 -SLC,Salt Lake City International Airport,Salt Lake City,UT,USA,40.78839,-111.97777 -SMF,Sacramento International Airport,Sacramento,CA,USA,38.69542,-121.59077 -SMX,Santa Maria Public Airport (Capt G. Allan Hancock Field),Santa Maria,CA,USA,34.89925,-120.45758 -SNA,John Wayne Airport (Orange County Airport),Santa Ana,CA,USA,33.67566,-117.86822 -SPI,Abraham Lincoln Capital Airport,Springfield,IL,USA,39.84395,-89.67762 -SPS,Wichita Falls Municipal Airport/Sheppard AFB,Wichita Falls,TX,USA,33.98880,-98.49189 -SRQ,Sarasota-Bradenton International Airport,Sarasota,FL,USA,27.39533,-82.55411 -STC,St. Cloud Regional Airport,St Cloud,MN,USA,45.54532,-94.05834 -STL,St. Louis International Airport at Lambert Field,St Louis,MO,USA,38.74769,-90.35999 -STT,Cyril E. King Airport,Charlotte Amalie,VI,USA,18.33731,-64.97336 -STX,Henry E. Rohlsen Airport,Christiansted,VI,USA,17.70189,-64.79856 -SUN,Friedman Memorial Airport,Hailey,ID,USA,43.50484,-114.29659 -SUX,Sioux Gateway Airport,Sioux City,IA,USA,42.40260,-96.38437 -SWF,Stewart International Airport,Newburgh,NY,USA,41.50409,-74.10484 -SYR,Syracuse Hancock International Airport,Syracuse,NY,USA,43.11119,-76.10631 -TLH,Tallahassee International Airport,Tallahassee,FL,USA,30.39653,-84.35033 -TOL,Toledo Express Airport,Toledo,OH,USA,41.58681,-83.80783 -TPA,Tampa International Airport,Tampa,FL,USA,27.97547,-82.53325 -TRI,Tri-Cities Regional Airport,Bristol,TN,USA,36.47521,-82.40742 -TTN,Trenton Mercer Airport,Trenton,NJ,USA,40.27669,-74.81347 -TUL,Tulsa International Airport,Tulsa,OK,USA,36.19837,-95.88824 -TUS,Tucson International Airport,Tucson,AZ,USA,32.11608,-110.94103 -TVC,Cherry Capital Airport,Traverse City,MI,USA,44.74144,-85.58224 -TWF,Magic Valley Regional Airport (Joslin Field),Twin Falls,ID,USA,42.48180,-114.48774 -TXK,Texarkana Regional Airport (Webb Field),Texarkana,AR,USA,33.45371,-93.99102 -TYR,Tyler Pounds Regional Airport,Tyler,TX,USA,32.35414,-95.40239 -TYS,McGhee Tyson Airport,Knoxville,TN,USA,35.81249,-83.99286 -UST,Northeast Florida Regional Airport (St. Augustine Airport),St. Augustine,FL,USA,, -VEL,Valdez Airport,Vernal,UT,USA,40.44090,-109.50992 -VLD,Valdosta Regional Airport,Valdosta,GA,USA,30.78250,-83.27672 -VPS,Destin-Fort Walton Beach Airport/Eglin AFB,Valparaiso,FL,USA,30.48325,-86.52540 -WRG,Wrangell Airport,Wrangell,AK,USA,56.48433,-132.36982 -WYS,Westerly State Airport,West Yellowstone,MT,USA,44.68840,-111.11764 -XNA,Northwest Arkansas Regional Airport,Fayetteville/Springdale/Rogers,AR,USA,36.28187,-94.30681 -YAK,Yakutat Airport,Yakutat,AK,USA,59.50336,-139.66023 -YUM,Yuma International Airport,Yuma,AZ,USA,32.65658,-114.60597 -ART,Watertown International Airport,Dexter,NY,USA,43.99190,-76.02169 -AZA,Phoenix-Mesa-Gateway Airport,Mesa,AZ,USA,33.30780029,-111.6549988 -BFF,Western Neb. Rgnl/William B. Heilig Airport,Scottsbluff,NE,USA,41.87400,-103.59600 -BKG,Branson,Hollister,MO,USA,36.53199,-93.20055 -CIC,Chico Municipal Airport,Chico,CA,USA,39.79539,-121.85800 -CYS,Cheyenne Regional Jerry Olson Field,Cheyenne,WY,USA,41.15570,-104.81199 -DRT,Del Rio International Airport,Del Rio,TX,USA,29.37420,-100.92700 -EFD,Ellington Airport,Houston,TX,USA,29.60729,-95.15879 -ENV,Wendover Airport,Wendover,UT,USA,40.71870,-114.03099 -FOE,Topeka Regional Airport - Forbes Field,Topeka,KS,USA,38.95090,-95.66359 -IPL,Imperial County Airport,Imperial,CA,USA,32.83420,-115.57900 -IYK,Inyokern Airport,Inyokern,CA,USA,35.65879,-117.8300018 -LMT,Klamath Falls Airport,Klamath Falls,OR,USA,42.15610,-121.73300 -MCN,Middle Georgia Regional Airport,Macon,GA,USA,32.69279,-83.64920 -MOD,Modesto City Co-Harry Sham Field,Modesto,CA,USA,37.62580,-120.95400 -PGD,Charlotte County Airport,Punta Gorda,FL,USA,26.92020,-81.99050 -RFD,Chicago Rockford International Airport,Rockford,IL,USA,42.19540,-89.097198 -SHD,Shenandoah Valley Regional Airport,Staunton,VA,USA,38.26380,-78.89640 -SPN,Saipan International Airport,Saipan,,CNMI,15.11900,145.72900 -TKI,Collin County Regional At Mc Kinney Airport,Dallas,TX,USA,33.17789,-96.59049 diff --git a/bookings/schema/cs_schema.sql b/bookings/schema/cs_schema.sql deleted file mode 100755 index c1a2383..0000000 --- a/bookings/schema/cs_schema.sql +++ /dev/null @@ -1,37 +0,0 @@ -use columnstore_schema; - -create table flights ( -year smallint, -month tinyint, -day tinyint, -day_of_week tinyint, -fl_date date, -carrier char(2), -tail_num char(6), -fl_num smallint, -origin varchar(5), -dest varchar(5), -crs_dep_time char(4), -dep_time char(4), -dep_delay smallint, -taxi_out smallint, -wheels_off char(4), -wheels_on char(4), -taxi_in smallint, -crs_arr_time char(4), -arr_time char(4), -arr_delay smallint, -cancelled smallint, -cancellation_code smallint, -diverted smallint, -crs_elapsed_time smallint, -actual_elapsed_time smallint, -air_time smallint, -distance smallint, -carrier_delay smallint, -weather_delay smallint, -nas_delay smallint, -security_delay smallint, -late_aircraft_delay smallint -) engine=columnstore default character set=utf8; - diff --git a/bookings/schema/idb_load_data.sql b/bookings/schema/idb_load_data.sql deleted file mode 100644 index ffd62df..0000000 --- a/bookings/schema/idb_load_data.sql +++ /dev/null @@ -1,11 +0,0 @@ -use innodb_schema; - -/* load airports data */ -LOAD DATA INFILE '/Developer-Examples/Bookings/schema/airports.csv' INTO TABLE airports -FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' -LINES TERMINATED BY '\n'; - -/* load airlines data */ -LOAD DATA INFILE '/Developer-Examples/Bookings/schema/airlines.csv' INTO TABLE airlines -FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' -LINES TERMINATED BY '\n'; \ No newline at end of file diff --git a/bookings/schema/idb_schema.sql b/bookings/schema/idb_schema.sql deleted file mode 100755 index db7e2fd..0000000 --- a/bookings/schema/idb_schema.sql +++ /dev/null @@ -1,77 +0,0 @@ -use innodb_schema; - --- Create syntax for TABLE 'airlines' -CREATE TABLE `airlines` ( - `iata_code` char(2) DEFAULT NULL, - `airline` varchar(30) DEFAULT NULL, - UNIQUE KEY `idx_iata_code` (`iata_code`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- Create syntax for TABLE 'airports' -CREATE TABLE `airports` ( - `iata_code` char(3) DEFAULT NULL, - `airport` varchar(80) DEFAULT NULL, - `city` varchar(30) DEFAULT NULL, - `state` char(2) DEFAULT NULL, - `country` varchar(30) DEFAULT NULL, - `latitude` float DEFAULT NULL, - `longitude` float DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- Create syntax for TABLE 'flights' -CREATE TABLE `flights` ( - `year` smallint(6) DEFAULT NULL, - `month` tinyint(4) DEFAULT NULL, - `day` tinyint(4) DEFAULT NULL, - `day_of_week` tinyint(4) DEFAULT NULL, - `fl_date` date DEFAULT NULL, - `carrier` char(2) DEFAULT NULL, - `tail_num` char(6) DEFAULT NULL, - `fl_num` smallint(6) DEFAULT NULL, - `origin` varchar(5) DEFAULT NULL, - `dest` varchar(5) DEFAULT NULL, - `crs_dep_time` char(4) DEFAULT NULL, - `dep_time` char(4) DEFAULT NULL, - `dep_delay` smallint(6) DEFAULT NULL, - `taxi_out` smallint(6) DEFAULT NULL, - `wheels_off` char(4) DEFAULT NULL, - `wheels_on` char(4) DEFAULT NULL, - `taxi_in` smallint(6) DEFAULT NULL, - `crs_arr_time` char(4) DEFAULT NULL, - `arr_time` char(4) DEFAULT NULL, - `arr_delay` smallint(6) DEFAULT NULL, - `cancelled` smallint(6) DEFAULT NULL, - `cancellation_code` char(1) DEFAULT NULL, - `diverted` smallint(6) DEFAULT NULL, - `crs_elapsed_time` smallint(6) DEFAULT NULL, - `actual_elapsed_time` smallint(6) DEFAULT NULL, - `air_time` smallint(6) DEFAULT NULL, - `distance` smallint(6) DEFAULT NULL, - `carrier_delay` smallint(6) DEFAULT NULL, - `weather_delay` smallint(6) DEFAULT NULL, - `nas_delay` smallint(6) DEFAULT NULL, - `security_delay` smallint(6) DEFAULT NULL, - `late_aircraft_delay` smallint(6) DEFAULT NULL, - KEY `idx_fl_num_dep_delay` (`fl_num`,`dep_delay`), - KEY `idx_fl_num_dep_delay_carrier` (`fl_num`,`dep_delay`,`carrier`), - KEY `idx_dep_delay` (`dep_delay`) -) ENGINE=InnoDB; - --- Create syntax for TABLE 'tickets' -CREATE TABLE `tickets` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `fl_date` date NOT NULL, - `fl_num` smallint(6) NOT NULL, - `carrier` char(2) NOT NULL DEFAULT '', - `origin` varchar(5) NOT NULL DEFAULT '', - `dest` varchar(5) NOT NULL DEFAULT '', - `price` decimal(9,2) NOT NULL DEFAULT 0.00, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; - --- Create syntax for TABLE 'trips' -CREATE TABLE `trips` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `ticket_id` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; diff --git a/bookings/src/.gitignore b/bookings/src/.gitignore deleted file mode 100644 index 8fdf499..0000000 --- a/bookings/src/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next \ No newline at end of file diff --git a/bookings/src/client/.gitignore b/bookings/src/client/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/bookings/src/client/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/bookings/src/client/README.md b/bookings/src/client/README.md deleted file mode 100644 index 859d27a..0000000 --- a/bookings/src/client/README.md +++ /dev/null @@ -1,68 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.Bookings
-A MariaDB Smart Transactions Demo
-- Flight score: -
-- {score} -
- -Price score |
- {assessment.price_score} | -
- Delay score -This flight is delayed {assessment.delay_percentage}% of the time. - |
- {assessment.delay_score} | -
- Cancellation score -This flight is canceled {assessment.cancel_percentage}% of the time. - |
- {assessment.cancel_score} | -
Avg. delay: {flight.avg_delay !== null ? Math.round(flight.avg_delay) : 0} minutes
-Flight duration: {this.getDuration(flight.dep_time,flight.arr_time)}
-Avg. flight duration: {this.getFormattedTimeFromInt(flight.avg_duration)}
-{flight.origin} - {flight.dest}
-
-
-
- Origin - {this.renderAirportOptions(this.state.selectedOriginOption,this.handleOriginChange)} - |
-
-
-
- Destination - {this.renderAirportOptions(this.state.selectedDestinationOption,this.handleDestinationChange)} - |
- ||
-
-
-
-
- Departing -
-
-
-
-
-
- Returning -
-
-
- |
-
-
-
-
-
- Adults (18+) - -
-
-
- Children (0-17) - - |
- ||
-
-
-
- |
-
- Historical score -- Based on historical analytics this flight has a {assessment.historical_delay_percentage}% - chance of being delayed. - - |
- {assessment.historical_score} | -
- Weather score - |
- {assessment.weather_score} | -
- Delay projection (minutes) -- This flight is delay probabilty has a multiplier of {assessment.weather_delay_multiplier} - due to current weather projections. - - |
- {assessment.projected_delay} | -
{assessment.overall_score}
-{this.getFormattedDate(trip.fl_date)}
-Low: {trip.forecast.temp_low}
-High: {trip.forecast.temp_high}
-Precip: {trip.forecast.precip_probability}
-Wind: {trip.forecast.wind_speed} mph
-Flight | -Departs | -Arrives | -Duration | -
---|---|---|---|
- {trip.airline_code} {trip.fl_num} - | -- {this.getFormattedTime(trip.dep_time)} - | -- {this.getFormattedTime(trip.arr_time)} - | -- {this.getDuration(trip.dep_time,trip.arr_time)} - | -
- |
-
-
-
- Estimated - {this.getFormattedOffsetTime(trip.dep_time,trip.assessment.projected_delay)} - |
-
-
-
- Estimated - {this.getFormattedOffsetTime(trip.arr_time,trip.assessment.projected_delay)} - |
- - - | -
- - - -
- -The following will walk you through the steps for getting this application up and running (locally) within minutes! This application is completely open source. Please feel free to use it and the source code as you see fit. - -# Table of Contents -1. [Environment and Compatibility](#compatibility) -2. [Getting started with MariaDB](#overview) - 1. [The Basics](#intro-mariadb) - 2. [Downloading and installing MariaDB ColumnStore](#installation) -3. [Requirements](#requirements) -4. [Getting started with the app](#getting-started) - 1. [Get the data, create the schema, and load the data](#data) - 1. [Grab the code](#grab-code) - 2. [Build the code](#build-code) - 3. [Run the app](#run-app) -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/) -* [React.js (v.16.12.0)](https://github.com/facebook/react/blob/master/CHANGELOG.md#16120-november-14-2019) -* [Node.js (v.12.x)](https://nodejs.org/docs/latest-v12.x/api/index.html) -* [NPM (v.6.11.3)](https://docs.npmjs.com/) - -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. - -- - - -
- -### Downloading and installing MariaDB ColumnStore - -[MariaDB ColumnStore](https://mariadb.com/docs/features/mariadb-columnstore/) extends [MariaDB Server](https://mariadb.com/products/) with distributed storage and massively parallel processing to support scalable, high-performance analytics. It can be deployed as the analytics component of MariaDB Platform using MariaDB MaxScale for change-data-capture and hybrid transactional/analytical query routing, or as a standalone columnar database for interactive, ad hoc analytics at scale. You can find more information on how to download and install ColumnStore [here](https://mariadb.com/downloads/#mariadb_platform-mariadb_columnstore). - -## Requirements - -This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies. - -* Download and install [MariaDB ColumnStore database](https://go.mariadb.com/download-mariadb-server-community.html?utm_source=google&utm_medium=ppc&utm_campaign=MKG-Search-Google-Branded-DL-NA-Server-DL&gclid=CjwKCAiAwZTuBRAYEiwAcr67OUBIqnFBo9rUBhYql3VZV_nhlSKzkwoUv7vhA6gwNdGoBSc2uWe7SBoCX_oQAvD_BwE). -* Download and install [NodeJS](https://nodejs.org/). -* 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 - -## Getting started - -### Get the data, create the schema, and load the data - -Instructions on retrieving and importing the flights dataset into a MariaDB ColumnStore database can be [here](https://github.com/mariadb-corporation/mariadb-columnstore-samples/tree/master/flights). Please note that he scripts provided within that repository only targets data for the year 2019 (~7.5 million records). - -If you'd like to retrieve data spanning from 1990 to 2019 (~180 million records) please use the following scripts: - -* [get_flight_data.sh](data/get_flight_data.sh) -* [create_flights_db.sh](data/create_flights_db.sh) -* [load_flights_data.sh](data/load_flights_data.sh) - -### Grab the code - -Download this code directly or use [git](git-scm.org) (through CLI or a client) to retrieve the code. - -### Configure the code - -Configure the MariaDB connection by [adding an .env file to the Node.js project](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#security-consideration). - -Example implementation: - -``` -DB_HOST=- -
- -2. Run the command: - -```bash -npm start -``` - -- -
- -3. Open a browser window and navigate to http://localhost:3000. - -- - - -
- -## Support and Contribution - -Thanks so much for taking a look at the Flights app! As this is a very simple example, there's a lot of potential for customization! - -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/flights/data/create_flights_db.sh b/flights/data/create_flights_db.sh deleted file mode 100644 index 27e8051..0000000 --- a/flights/data/create_flights_db.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -SCHEMA_DIR=$(readlink -f ./schema) -# create flights database (dropping if exists) with 3 columnstore tables: flights, airports, airlines -/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/schema.sql -# load data into dimension tables airports and airlines. -/usr/bin/cpimport -m 2 -s ',' -E '"' flights airports -l $SCHEMA_DIR/airports.csv -/usr/bin/cpimport -m 2 -s ',' -E '"' flights airlines -l $SCHEMA_DIR/airlines.csv \ No newline at end of file diff --git a/flights/data/get_flight_data.sh b/flights/data/get_flight_data.sh deleted file mode 100644 index 9ae2cdf..0000000 --- a/flights/data/get_flight_data.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# This script will remotely invoke the bureau of transportation statistics web form to retrieve data by month: -# https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236&DB_Short_Name=On-Time -# for the specific columns listed in the SQL and utilized by the sample schema. -mkdir -p data -for y in {1990..2019}; do - for m in {1..12}; do - yyyymm="$y-$(printf %02d $m)" - echo "$yyyymm" - curl -L -o data.zip -d "sqlstr=+SELECT+YEAR%2CMONTH%2CDAY_OF_MONTH%2CDAY_OF_WEEK%2CFL_DATE%2CCARRIER%2CTAIL_NUM%2CFL_NUM%2CORIGIN%2CDEST%2CCRS_DEP_TIME%2CDEP_TIME%2CDEP_DELAY%2CTAXI_OUT%2CWHEELS_OFF%2CWHEELS_ON%2CTAXI_IN%2CCRS_ARR_TIME%2CARR_TIME%2CARR_DELAY%2CCANCELLED%2CCANCELLATION_CODE%2CDIVERTED%2CCRS_ELAPSED_TIME%2CACTUAL_ELAPSED_TIME%2CAIR_TIME%2CDISTANCE%2CCARRIER_DELAY%2CWEATHER_DELAY%2CNAS_DELAY%2CSECURITY_DELAY%2CLATE_AIRCRAFT_DELAY+FROM++T_ONTIME+WHERE+Month+%3D$m+AND+YEAR%3D$y" https://www.transtats.bts.gov/DownLoad_Table.asp?Table_ID=236 - rm -f *.csv - unzip data.zip - rm -f data.zip - mv *.csv $yyyymm.csv - tail -n +2 $yyyymm.csv > data/$yyyymm.csv - rm -f $yyyymm.csv - done -done \ No newline at end of file diff --git a/flights/data/load_flights_data.sh b/flights/data/load_flights_data.sh deleted file mode 100644 index 2ccd8c6..0000000 --- a/flights/data/load_flights_data.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -SCHEMA_DIR=$(readlink -f ./schema) -# create flights database (dropping if exists) with 3 columnstore tables: flights, airports, airlines -/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/schema.sql -# load data into dimension tables airports and airlines. -/usr/bin/cpimport -m 2 -s ',' -E '"' flights airports -l $SCHEMA_DIR/airports.csv -/usr/bin/cpimport -m 2 -s ',' -E '"' flights airlines -l $SCHEMA_DIR/airlines.csv -[root@flight-demo-mdb-cs-single-0 data]# cat -load^C -[root@flight-demo-mdb-cs-single-0 data]# cat load_flight_data.sh -#!/bin/bash -# check for argument, if so use as wildcard for file load match, otherwise load everything -DATA_DIR=$(readlink -f ./data) -filematch="*" -if [ $# -eq 1 ] -then - filematch="*$1*" -fi -# load the specified files under the data directory with the file pattern match -# here we use cpimport mode 2 to force processing at each PM node which has -# the advantage of this being runnable as a regular user with a root installation. -for f in $DATA_DIR/$filematch.csv; do - echo $f - /usr/bin/cpimport -m2 -s ',' -E '"' flights flights -l $f -done \ No newline at end of file diff --git a/flights/media/cli_root.png b/flights/media/cli_root.png deleted file mode 100644 index df8d98a..0000000 Binary files a/flights/media/cli_root.png and /dev/null differ diff --git a/flights/media/demo.gif b/flights/media/demo.gif deleted file mode 100644 index 57dd1e3..0000000 Binary files a/flights/media/demo.gif and /dev/null differ diff --git a/flights/media/get_started.png b/flights/media/get_started.png deleted file mode 100644 index 48429b3..0000000 Binary files a/flights/media/get_started.png and /dev/null differ diff --git a/flights/media/npm_start.png b/flights/media/npm_start.png deleted file mode 100644 index e3e681f..0000000 Binary files a/flights/media/npm_start.png and /dev/null differ diff --git a/flights/media/platform.png b/flights/media/platform.png deleted file mode 100644 index 5189f12..0000000 Binary files a/flights/media/platform.png and /dev/null differ diff --git a/flights/src/.gitignore b/flights/src/.gitignore deleted file mode 100644 index 8fdf499..0000000 --- a/flights/src/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next \ No newline at end of file diff --git a/flights/src/client/.gitignore b/flights/src/client/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/flights/src/client/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/flights/src/client/README.md b/flights/src/client/README.md deleted file mode 100644 index 859d27a..0000000 --- a/flights/src/client/README.md +++ /dev/null @@ -1,68 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.Real-Time Flight Analytics
-A MariaDB ColumnStore Demo
-Delay % By Type
-Airline (avg minutes) delays vs. All (avg minutes) delays
-{this.props.origin.code} |
- - | {this.props.destination.code} |
-
-
-
- Origin - {this.renderAirportOptions(this.state.selectedOriginOption,this.handleOriginChange)} - |
-
-
-
- Destination - {this.renderAirportOptions(this.state.selectedDestinationOption,this.handleDestinationChange)} - |
-
-
-
- Airline - {this.renderAirlineOptions(this.state.selectedAirlineOption,this.handleAirlineChange)} - |
-
-
-
-
-
- From - -
-
- To - -
-
- Month - -
-
- Day - - |
-
- - | -
- - - -
- -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 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 - -This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies. - -* Download and install [MariaDB](#installation). -* 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 - -## Getting started with Apache Zeppelin - -### Adding a MariaDB interpreter - -Once you've downloaded and installed Apache Zeppelin you will need to add a new [interpreter](https://zeppelin.apache.org/docs/0.8.2/usage/interpreter/overview.html) for MariaDB using the following steps: - -1. Navigate to "Interpreter". - -- - - -
- -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): 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. -* [bitemporal-table-demo](bitemporal-table-demo.json): A comprehensive look at a MariaDB Bitemporal table. - -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/bitemporal-table-demo.json b/modern-sql/bitemporal-table-demo.json deleted file mode 100644 index bdea850..0000000 --- a/modern-sql/bitemporal-table-demo.json +++ /dev/null @@ -1 +0,0 @@ -{"paragraphs":[{"title":"Create a new database","text":"%mariadb\n\nCREATE DATABASE accounting;\n","user":"anonymous","dateUpdated":"2020-03-26T14:12:22+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"Database":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065832325_764911294","id":"20200324-160352_592975270","dateCreated":"2020-03-24T16:03:52+0000","dateStarted":"2020-03-26T14:12:22+0000","dateFinished":"2020-03-26T14:12:22+0000","status":"FINISHED","progressUpdateIntervalMs":500,"focus":true,"$$hashKey":"object:81724","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]}},{"title":"Create a new bitemporal table","text":"%mariadb\n\nCREATE TABLE accounting.employees (\n id INT NOT NULL AUTO_INCREMENT,\n first_name VARCHAR(100) NOT NULL,\n last_name VARCHAR(100) NOT NULL,\n department VARCHAR(25) NOT NULL,\n salary DECIMAL(9,2) NOT NULL,\n date_start DATE NOT NULL,\n date_end DATE NOT NULL DEFAULT '9999-12-31',\n PERIOD FOR emp_period(date_start, date_end),\n PRIMARY KEY (id)\n) WITH SYSTEM VERSIONING;\n","user":"anonymous","dateUpdated":"2020-03-26T14:12:26+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064575704_-1680557328","id":"20200324-154255_1444580934","dateCreated":"2020-03-24T15:42:55+0000","dateStarted":"2020-03-26T14:12:26+0000","dateFinished":"2020-03-26T14:12:26+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81725","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 0"}]}},{"title":"Insert values","text":"%mariadb\n\nINSERT INTO accounting.employees (first_name, last_name, department, salary, date_start) \nVALUES \n ('Tracy', 'Smith', 'HR', 65000.00, '2016-01-01'),\n ('James', 'Brown', 'MKT', 45000.00, '2016-04-15'),\n ('Stacy', 'Crowder', 'ENG', 80000.00, '2017-08-23'),\n ('Kim', 'Martin', 'PM', 75000.00, '2017-08-23'),\n ('Zachary', 'Quinto', 'SALES', 55000.00, '2019-01-08');","user":"anonymous","dateUpdated":"2020-03-26T14:12:32+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":false,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064594174_1816822916","id":"20200324-154314_1434900945","dateCreated":"2020-03-24T15:43:14+0000","dateStarted":"2020-03-26T14:12:32+0000","dateFinished":"2020-03-26T14:12:32+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81726","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 5"}]}},{"title":"Verify the data has been inserted","text":"%mariadb\n\nSELECT * FROM accounting.employees;","user":"anonymous","dateUpdated":"2020-03-26T14:12:39+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"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,"editorHide":false,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064637845_201532895","id":"20200324-154357_83239763","dateCreated":"2020-03-24T15:43:57+0000","dateStarted":"2020-03-26T14:12:39+0000","dateFinished":"2020-03-26T14:12:39+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81727","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\n4\tKim\tMartin\tPM\t75000.00\t2017-08-23\t9999-12-31\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\n"}]}},{"title":"Show invisible system columns","text":"%mariadb\n\nSELECT *, row_start, row_end FROM accounting.employees;","user":"anonymous","dateUpdated":"2020-03-26T14:13: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","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064673286_-1320019599","id":"20200324-154433_1061364857","dateCreated":"2020-03-24T15:44:33+0000","dateStarted":"2020-03-26T14:13:05+0000","dateFinished":"2020-03-26T14:13:05+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81728","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\trow_start\trow_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n4\tKim\tMartin\tPM\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n"}]}},{"title":"Update a record","text":"%mariadb\n\n/* Updating records */\n\nUPDATE \n accounting.employees\nSET\n department = 'ENG'\nWHERE\n first_name = 'Kim' AND\n last_name = 'Martin'","user":"anonymous","dateUpdated":"2020-03-26T14:13:41+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":false,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065059116_1220660323","id":"20200324-155059_837291643","dateCreated":"2020-03-24T15:50:59+0000","dateStarted":"2020-03-26T14:13:41+0000","dateFinished":"2020-03-26T14:13:41+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81729","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]}},{"title":"Select all","text":"%mariadb\n\nSELECT * FROM accounting.employees;","user":"anonymous","dateUpdated":"2020-03-26T14:14: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","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"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","title":true,"editorHide":false},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585219193392_18728220","id":"20200326-103953_171419324","dateCreated":"2020-03-26T10:39:53+0000","dateStarted":"2020-03-26T14:14:05+0000","dateFinished":"2020-03-26T14:14:05+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81730","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\n4\tKim\tMartin\tENG\t75000.00\t2017-08-23\t9999-12-31\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\n"}]}},{"title":"Select all record history","text":"%mariadb\n\nSELECT \n *, row_start, row_end \nFROM \n accounting.employees\nFOR SYSTEM_TIME ALL;","user":"anonymous","dateUpdated":"2020-03-26T14:14:39+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585162661085_-760439612","id":"20200325-185741_788812261","dateCreated":"2020-03-25T18:57:41+0000","dateStarted":"2020-03-26T14:14:39+0000","dateFinished":"2020-03-26T14:14:39+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81731","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\trow_start\trow_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n4\tKim\tMartin\tPM\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2020-03-26 14:13:41.479071\n4\tKim\tMartin\tENG\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:13:41.479071\t2038-01-19 03:14:07.999999\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n"}]}},{"title":"Select point in time record history","text":"%mariadb\n\nSELECT \n *, row_start, row_end \nFROM \n accounting.employees\nFOR SYSTEM_TIME \n AS OF '2020-03-26 14:15';","user":"anonymous","dateUpdated":"2020-03-26T14:15:41+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065089728_1360783316","id":"20200324-155129_1147982860","dateCreated":"2020-03-24T15:51:29+0000","dateStarted":"2020-03-26T14:15:41+0000","dateFinished":"2020-03-26T14:15:41+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81732","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\trow_start\trow_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n4\tKim\tMartin\tENG\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:13:41.479071\t2038-01-19 03:14:07.999999\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n"}]}},{"title":"Delete a record","text":"%mariadb\n\nDELETE \nFROM \n accounting.employees \nWHERE \n first_name = 'Kim' AND \n last_name = 'Martin'\n ","user":"anonymous","dateUpdated":"2020-03-26T14:15:55+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":false,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585227905512_-222925780","id":"20200326-130505_341897323","dateCreated":"2020-03-26T13:05:05+0000","dateStarted":"2020-03-26T14:15:55+0000","dateFinished":"2020-03-26T14:15:55+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81733","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 1"}]}},{"title":"Select all records","text":"%mariadb\n\nSELECT \n *, row_start, row_end \nFROM \n accounting.employees\nFOR SYSTEM_TIME ALL;","user":"anonymous","dateUpdated":"2020-03-26T14:16:11+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585169870238_-1575218208","id":"20200325-205750_476271147","dateCreated":"2020-03-25T20:57:50+0000","dateStarted":"2020-03-26T14:16:11+0000","dateFinished":"2020-03-26T14:16:11+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81734","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\trow_start\trow_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n4\tKim\tMartin\tPM\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2020-03-26 14:13:41.479071\n4\tKim\tMartin\tENG\t75000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:13:41.479071\t2020-03-26 14:15:55.273453\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n"}]}},{"title":"Pruning historical records","text":"%mariadb\n\nDELETE HISTORY FROM accounting.employees;","user":"anonymous","dateUpdated":"2020-03-26T14:16:43+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":false,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585169568397_2099234171","id":"20200325-205248_768881626","dateCreated":"2020-03-25T20:52:48+0000","dateStarted":"2020-03-26T14:16:43+0000","dateFinished":"2020-03-26T14:16:43+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81735","results":{"code":"SUCCESS","msg":[{"type":"TEXT","data":"Query executed successfully. Affected rows : 2"}]}},{"title":"Select all record history","text":"%mariadb\n\nSELECT \n *, row_start, row_end \nFROM \n accounting.employees\nFOR SYSTEM_TIME ALL;","user":"anonymous","dateUpdated":"2020-03-26T14:16:50+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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","title":true,"editorHide":false},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585228277797_-78515165","id":"20200326-131117_409193005","dateCreated":"2020-03-26T13:11:17+0000","dateStarted":"2020-03-26T14:16:50+0000","dateFinished":"2020-03-26T14:16:50+0000","status":"FINISHED","progressUpdateIntervalMs":500,"$$hashKey":"object:81736","results":{"code":"SUCCESS","msg":[{"type":"TABLE","data":"id\tfirst_name\tlast_name\tdepartment\tsalary\tdate_start\tdate_end\trow_start\trow_end\n1\tTracy\tSmith\tHR\t65000.00\t2016-01-01\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n2\tJames\tBrown\tMKT\t45000.00\t2016-04-15\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n3\tStacy\tCrowder\tENG\t80000.00\t2017-08-23\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n5\tZachary\tQuinto\tSALES\t55000.00\t2019-01-08\t9999-12-31\t2020-03-26 14:12:32.208386\t2038-01-19 03:14:07.999999\n"}]}},{"title":"Truncate table","text":"%mariadb\n\nTRUNCATE accounting.employees;","user":"anonymous","dateUpdated":"2020-03-26T14:17:19+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"first_name":"string","last_name":"string","department":"string","salary":"string","row_start":"string","row_end":"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,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064716860_-1839112079","id":"20200324-154516_1936751554","dateCreated":"2020-03-24T15:45:16+0000","dateStarted":"2020-03-26T14:17:19+0000","dateFinished":"2020-03-26T14:17:19+0000","status":"ERROR","progressUpdateIntervalMs":500,"$$hashKey":"object:81737","results":{"code":"ERROR","msg":[{"type":"TEXT","data":"java.sql.SQLException: (conn=164195) System-versioned tables do not support TRUNCATE TABLE\n\tat org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:261)\n\tat org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:171)\n\tat org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:248)\n\tat org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:338)\n\tat org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:389)\n\tat org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)\n\tat org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)\n\tat org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:736)\n\tat org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:819)\n\tat org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:103)\n\tat org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:632)\n\tat org.apache.zeppelin.scheduler.Job.run(Job.java:188)\n\tat org.apache.zeppelin.scheduler.ParallelScheduler$JobRunner.run(ParallelScheduler.java:162)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: java.sql.SQLException: System-versioned tables do not support TRUNCATE TABLE\n\tat org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1594)\n\tat org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1453)\n\tat org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1415)\n\tat org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:228)\n\tat org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:332)\n\t... 16 more\n"}]}},{"title":"Update record for (application) time period","text":"%mariadb\n\nUPDATE accounting.employees \n FOR PORTION OF emp_period\n FROM '2018-06-01' \n TO '9999-12-31'\nSET \n salary = 100000.00\nWHERE \n first_name = 'Stacy' AND \n last_name = 'Crowder';","user":"anonymous","dateUpdated":"2020-03-26T13:24:16+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":true,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585064790970_-1687434071","id":"20200324-154630_1925074865","dateCreated":"2020-03-24T15:46:30+0000","dateStarted":"2020-03-26T10:45:49+0000","dateFinished":"2020-03-26T10:45:49+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81738"},{"title":"Select all records","text":"%mariadb\n\nSELECT \n *\nFROM\n accounting.employees\nWHERE\n first_name = 'Stacy' AND \n last_name = 'Crowder';\n","user":"anonymous","dateUpdated":"2020-03-26T13:24:16+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{"0":{"graph":{"mode":"table","height":300,"optionOpen":false,"setting":{"table":{"tableGridState":{},"tableColumnTypeState":{"names":{"id":"string","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"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":true,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065034125_-2096877662","id":"20200324-155034_1886359465","dateCreated":"2020-03-24T15:50:34+0000","dateStarted":"2020-03-26T10:46:27+0000","dateFinished":"2020-03-26T10:46:27+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81739"},{"title":"Update record for (application) time period","text":"%mariadb\n\nUPDATE accounting.employees \n FOR PORTION OF emp_period\n FROM '2019-06-01' \n TO '9999-12-31'\nSET \n salary = 110000.00\nWHERE \n first_name = 'Stacy' AND \n last_name = 'Crowder';","user":"anonymous","dateUpdated":"2020-03-26T13:24:16+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":true,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585218717363_-1137613692","id":"20200326-103157_1857628698","dateCreated":"2020-03-26T10:31:57+0000","dateStarted":"2020-03-26T10:46:36+0000","dateFinished":"2020-03-26T10:46:36+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81740"},{"title":"Select all (including invisible system columns) records","text":"%mariadb\n\nSELECT \n *, row_start, row_end\nFROM\n accounting.employees\nWHERE\n first_name = 'Stacy' AND \n last_name = 'Crowder';","user":"anonymous","dateUpdated":"2020-03-26T13:24: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","first_name":"string","last_name":"string","department":"string","salary":"string","date_start":"string","date_end":"string","row_start":"string","row_end":"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":true,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065293787_-2069181478","id":"20200324-155453_219421060","dateCreated":"2020-03-24T15:54:53+0000","dateStarted":"2020-03-26T10:46:59+0000","dateFinished":"2020-03-26T10:46:59+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81741"},{"title":"Delete records by (application) time period","text":"%mariadb\n\nDELETE FROM accounting.employees \n FOR PORTION OF emp_period\n FROM '2018-10-01'\n TO '2018-10-31'\nWHERE \n first_name = 'Stacy' AND \n last_name = 'Crowder'\n","user":"anonymous","dateUpdated":"2020-03-26T13:24:17+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":true,"title":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585065320654_-147847794","id":"20200324-155520_1028810612","dateCreated":"2020-03-24T15:55:20+0000","dateStarted":"2020-03-26T10:46:54+0000","dateFinished":"2020-03-26T10:46:54+0000","status":"FINISHED","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81742"},{"text":"%mariadb\n","user":"anonymous","dateUpdated":"2020-03-26T13:24:17+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"sql","editOnDblClick":false,"completionKey":"TAB","completionSupport":true},"editorMode":"ace/mode/sql","editorHide":true},"settings":{"params":{},"forms":{}},"apps":[],"jobName":"paragraph_1585170384080_-1147965783","id":"20200325-210624_1787726974","dateCreated":"2020-03-25T21:06:24+0000","status":"READY","errorMessage":"","progressUpdateIntervalMs":500,"$$hashKey":"object:81743"}],"name":"Bitemporal Table Demo","id":"2F6WVQE11","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/create_schema_data.sql b/modern-sql/create_schema_data.sql deleted file mode 100644 index 711814c..0000000 --- a/modern-sql/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/modern-sql/demo_1.json b/modern-sql/demo_1.json deleted file mode 100644 index cb92ae4..0000000 --- a/modern-sql/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/modern-sql/demo_2.json b/modern-sql/demo_2.json deleted file mode 100644 index e9218d6..0000000 --- a/modern-sql/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/modern-sql/demo_3.json b/modern-sql/demo_3.json deleted file mode 100644 index 3409651..0000000 --- a/modern-sql/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/modern-sql/media/artifact.png b/modern-sql/media/artifact.png deleted file mode 100644 index efc7e64..0000000 Binary files a/modern-sql/media/artifact.png and /dev/null differ diff --git a/modern-sql/media/demo.gif b/modern-sql/media/demo.gif deleted file mode 100644 index 937a3d5..0000000 Binary files a/modern-sql/media/demo.gif and /dev/null differ diff --git a/modern-sql/media/import.png b/modern-sql/media/import.png deleted file mode 100644 index ff1e78f..0000000 Binary files a/modern-sql/media/import.png and /dev/null differ diff --git a/modern-sql/media/interpreter.png b/modern-sql/media/interpreter.png deleted file mode 100644 index a302599..0000000 Binary files a/modern-sql/media/interpreter.png and /dev/null differ diff --git a/modern-sql/media/name.png b/modern-sql/media/name.png deleted file mode 100644 index 8cb3e79..0000000 Binary files a/modern-sql/media/name.png and /dev/null differ diff --git a/modern-sql/media/platform.png b/modern-sql/media/platform.png deleted file mode 100644 index 5189f12..0000000 Binary files a/modern-sql/media/platform.png and /dev/null differ diff --git a/orders/README.md b/orders/README.md index 13140f4..8fc46ed 100644 --- a/orders/README.md +++ b/orders/README.md @@ -2,174 +2,3 @@ This application is no longer being maintained here. It has been moved to [**this repository**](https://github.com/mariadb-corporation/dev-example-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/) by simulating online eCommerce (ordering) traffic. - -- - - -
- -The following will walk you through the steps for getting this application up and running (locally) within minutes! This application is completely open source. Please feel free to use it and the source code as you see fit. - -# Table of Contents -1. [Environment and Compatibility](#compatibility) -2. [Getting start with MariaDB](#overview) - 1. [The Basics](#intro-mariadb) - 2. [Create the schema](#create-schema) -3. [Requirements to run the app](#requirements) -4. [Getting started with the app](#getting-started) - 1. [Grab the code](#grab-code) - 2. [Build the code](#build-code) - 3. [Run the app](#run-app) -5. [Support and Contribution](#support-contribution) -6. [License](#license) - -## Environment and Compatibility - -This sample was created using the following techologies: - -* [MariaDB Platform](https://mariadb.com/products/) -* [React.js (v.16.12.0)](https://github.com/facebook/react/blob/master/CHANGELOG.md#16120-november-14-2019) -* [Node.js (v.12.x)](https://nodejs.org/docs/latest-v12.x/api/index.html) -* [NPM (v.6.11.3)](https://docs.npmjs.com/) - -This sample was tested on macOS v.10.14.6. - -## 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. - -
-
- -
- -2. Run the command: - -```bash -$ npm start -``` - -- -
- -3. Open a browser window and navigate to http://localhost:3000. - -- - - -
- -## Support and Contribution - -Thanks so much for taking a look at the Bookings app! As this is a very simple example, there's plenty of potential for customization. Please feel free to submit PR's to the project to include your modifications! - -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/orders/create_schema.sh b/orders/create_schema.sh deleted file mode 100644 index c6c55ca..0000000 --- a/orders/create_schema.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -SCHEMA_DIR=$(readlink -f ./schema) - -# create orders database and table -/usr/bin/mysql --defaults-file=/etc/my.cnf -u root -vvv < $SCHEMA_DIR/create.sql \ No newline at end of file diff --git a/orders/media/cli_root.png b/orders/media/cli_root.png deleted file mode 100644 index 4eb98df..0000000 Binary files a/orders/media/cli_root.png and /dev/null differ diff --git a/orders/media/demo.gif b/orders/media/demo.gif deleted file mode 100644 index 12a3de4..0000000 Binary files a/orders/media/demo.gif and /dev/null differ diff --git a/orders/media/get_started.png b/orders/media/get_started.png deleted file mode 100644 index cd086b8..0000000 Binary files a/orders/media/get_started.png and /dev/null differ diff --git a/orders/media/npm_start.png b/orders/media/npm_start.png deleted file mode 100644 index b51c161..0000000 Binary files a/orders/media/npm_start.png and /dev/null differ diff --git a/orders/media/platform.png b/orders/media/platform.png deleted file mode 100644 index 5189f12..0000000 Binary files a/orders/media/platform.png and /dev/null differ diff --git a/orders/schema/create.sql b/orders/schema/create.sql deleted file mode 100644 index a75c6a0..0000000 --- a/orders/schema/create.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE DATABASE orders; - -CREATE TABLE orders.orders ( - description varchar(50) -) ENGINE=InnoDB; diff --git a/orders/src/.gitignore b/orders/src/.gitignore deleted file mode 100644 index 8fdf499..0000000 --- a/orders/src/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next \ No newline at end of file diff --git a/orders/src/client/.gitignore b/orders/src/client/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/orders/src/client/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/orders/src/client/README.md b/orders/src/client/README.md deleted file mode 100644 index 859d27a..0000000 --- a/orders/src/client/README.md +++ /dev/null @@ -1,68 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.Orders
-A MariaDB Demo
-Read %:
- -Write %:
- -Variation %:
- -Queries per second
-{this.props.qps}
-Average latency
-{this.props.average_transaction_time} ms
-Reads and Writes per second
-Transaction latency per second
-- - - -
- -The following will walk you through the steps for getting this application up and running (locally) within minutes! This application is completely open source. Please feel free to use it and the source code as you see fit. - -# Table of Contents -1. [Environment and Compatibility](#compatibility) -2. [Overview](#overview) - 1. [Introduction to MariaDB](#intro-mariadb) - 2. [Using JSON in a relational database](#json-relational) -3. [Requirements](#requirements) -4. [Getting started](#getting-started) - 1. [Grab the code](#grab-code) - 2. [Build the code](#build-code) - 3. [Run the app](#run-app) -5. [JSON Data Models](#data-models) -6. [Support and Contribution](#support-contribution) -7. [License](#license) - -## Environment and Compatibility - -This application was created using the following techologies: - -* [MariaDB](https://mariadb.com/products/mariadb-platform/) -* [React.js (v.16.11.0)](https://github.com/facebook/react/blob/master/CHANGELOG.md#16110-october-22-2019) -* [Node.js (v.12.x)](https://nodejs.org/docs/latest-v12.x/api/index.html) -* [NPM (v.6.11.3)](https://docs.npmjs.com/) - -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. - -- - - -
- -### Using JSON in a relational database - -[JSON](https://www.json.org) is fast becoming the standard format for data interchange and for unstructured data, and MariaDB Platform (in fact, all MariaDB versions 10.2 and later) include a range of [JSON supporting functions](https://mariadb.com/topic/json/). - -The Places application uses only a **single table** for all location, and uses JSON to store more specific information based on the location type. - -```sql -CREATE TABLE `Locations` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL DEFAULT '', - `description` varchar(500) DEFAULT '', - `type` char(1) NOT NULL DEFAULT '', - `latitude` decimal(9,6) NOT NULL, - `longitude` decimal(9,6) NOT NULL, - `attr` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attr`)), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4; -``` - -For more information on how JSON can be used within MariaDB please check out this [blog post](https://mariadb.com/resources/blog/json-with-mariadb-10-2/)! - - -## Requirements - -This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies. - -* Download and install [MariaDB](https://go.mariadb.com/download-mariadb-server-community.html?utm_source=google&utm_medium=ppc&utm_campaign=MKG-Search-Google-Branded-DL-NA-Server-DL&gclid=CjwKCAiAwZTuBRAYEiwAcr67OUBIqnFBo9rUBhYql3VZV_nhlSKzkwoUv7vhA6gwNdGoBSc2uWe7SBoCX_oQAvD_BwE). -* Download and install [NodeJS](https://nodejs.org/). -* 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 - -## Getting started - -In order to run the Places application you will need to have a MariaDB instance to connect to. For more information please check out "[Get Started with MariaDB](https://mariadb.com/get-started-with-mariadb/)". - -In order to build and run the Places applications you will need to have NodeJS installed. You can find more information [here](https://nodejs.org/). - -### Create the schema - -Using CLI or SQL client run the following SQL command: - -```sql -CREATE TABLE `Locations` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL DEFAULT '', - `description` varchar(500) DEFAULT '', - `type` char(1) NOT NULL DEFAULT '', - `latitude` decimal(9,6) NOT NULL, - `longitude` decimal(9,6) NOT NULL, - `attr` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`attr`)), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4; -``` - -### Grab the code - -Download this code directly or use [git](git-scm.org) (through CLI or a client) to retrieve the code. - -### Configure the code - -**The gist;** Add a Google Maps API Key and database connection information to the code. - -1. Once you've obtained a Google Maps API Key place add it to the code [here](src/client/src/components/MapContainer.js#L248). - -```js -export default GoogleApiWrapper({ - apiKey: ("ENTER_GOOGLE_API_KEY") -})(MapContainer) -``` - -2. Configure the MariaDB connection by [adding an .env file to the Node.js project](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#security-consideration). - -Example implementation: - -``` -DB_HOST=- -
- -2. Run the command: - -```bash -npm start -``` - -- -
- -3. Open a browser window and navigate to http://localhost:3000. - -## JSON Data Models - -Below are samples of the data model per Location Type. - -**Attraction** -```json -{ - "category":"Landmark", - "lastVisitDate":"11/5/2019" -} -``` - -**Location** -```json -{ - "details":{ - "foodType":"Pizza", - "menu":"www.giodanos.com/menu" - }, - "favorites":[ - { - "description":"Classic Chicago", - "price":24.99 - }, - { - "description":"Salad", - "price":9.99 - } - ] -} -``` - -**Sports Venue** -```json -{ - "details":{ - "yearOpened":1994, - "capacity":23500 - }, - "events":[ - { - "date":"10/18/2019", - "description":"Bulls vs Celtics" - }, - { - "date":"10/21/2019", - "description":"Bulls vs Lakers" - }, - { - "date":"11/5/2019", - "description":"Bulls vs Bucks" - }, - { - "date":"11/5/2019", - "description":"Blackhawks vs Blues" - } - ] -} -``` - -## Support and Contribution - -Thanks so much for taking a look at the Places app! As this is a very simple example,there's a lot of potential for customization! - -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/places/media/cli_root.png b/places/media/cli_root.png deleted file mode 100644 index c17bafc..0000000 Binary files a/places/media/cli_root.png and /dev/null differ diff --git a/places/media/map.png b/places/media/map.png deleted file mode 100644 index 41a8527..0000000 Binary files a/places/media/map.png and /dev/null differ diff --git a/places/media/npm_start.png b/places/media/npm_start.png deleted file mode 100644 index a6b7793..0000000 Binary files a/places/media/npm_start.png and /dev/null differ diff --git a/places/media/platform.png b/places/media/platform.png deleted file mode 100644 index 5189f12..0000000 Binary files a/places/media/platform.png and /dev/null differ diff --git a/places/src/.gitignore b/places/src/.gitignore deleted file mode 100644 index 8fdf499..0000000 --- a/places/src/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -# next.js build output -.next \ No newline at end of file diff --git a/places/src/client/.gitignore b/places/src/client/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/places/src/client/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/places/src/client/README.md b/places/src/client/README.md deleted file mode 100644 index 859d27a..0000000 --- a/places/src/client/README.md +++ /dev/null @@ -1,68 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.Date: | -|
Description: | -- |
Type: | -- - | -
Name: | -- |
Description: | -- |
Latitude: | -- |
Longitude: | -- |
Description: | -- |
Price: | -- |
this.openModal(location, this.toggleViewLocationModal)}>View Details
-{location.description}
-this.openModal(location, this.toggleViewLocationModal)}>View Details
-{location.description}
-Last visited
- {location.description} -this.openModal(location, this.toggleUpdateLastVisitModal)}>Update Last Visit
-Description | -Price | -
---|
Type: | -{this.state.restaurant.foodType} | -
Menu: | -{this.state.restaurant.menu} | -
Date | -Description | -
---|
Year Opened: | -{this.state.venue.yearOpened} | -
Max Capacity: | -{this.state.venue.capacity} | -
Attraction: | -{this.props.name} | -
Date: | -