385ac120ef | ||
---|---|---|
media | ||
sql | ||
zeppelin | ||
LICENSE | ||
README.md |
README.md
Modern SQL, MariaDB, and Apache Zeppelin!
⚠️ [UNMAINTAINED] This repository has been moved and is currently maintained here. ⚠️
MariaDB implements more of the standard SQL specification than any other open source database, adding support for common table expressions (CTEs), window functions, temporal data tables and many other features over the last few years.
The following will walk you through the steps for setting up Apache Zeppelin to integrate with MariaDB and work with several samples of modern SQL functionality.
Table of Contents
- Requirements
- Introduction to MariaDB
- Preparing the database
- Using Apache Zeppelin
- Raw Queries
- Support and Contribution
- License
Environment and Compatibility
This project assumes you have familiarity with building web applications using ReactJS and NodeJS technologies.
- Download and install MariaDB.
- Download and install Apache Zeppelin.
- git (Optional) - this is required if you would prefer to pull the source code from GitHub repo.
- Create a free github account if you don’t already have one
- git can be downloaded from git-scm.org
Introduction to MariaDB
MariaDB Platform
MariaDB Platform integrates transactional and analytical products so developers can build modern applications by enriching transactions with real-time analytics and historical data, creating insightful experiences and compelling opportunities for customers – and for businesses, endless ways to monetize data.
To get started using MariaDB locally you can choose one of the following options:
MariaDB SkySQL
SkySQL is the first and only database-as-a-service (DBaaS) to bring the full power of MariaDB Platform to the cloud, including its support for transactional, analytical and hybrid workloads. Built on Kubernetes, and optimized for cloud infrastructure and services, SkySQL combines ease of use and self-service with enterprise reliability and world-class support – everything needed to safely run mission-critical databases in the cloud, and with enterprise governance.
Preparing the database
Create the schema
Next execute the SQL within schema.sql either manually within a new database, or using the MariaDB client:
Locally (with root and empty password):
$ mariadb < sql/schema.sql
MariaDB SkySQL:
mariadb --host tx-1.mdb0001390.db.skysql.net --port 5002 --user DB00003108 -pPassword123! --ssl-ca ~/Downloads/skysql_chain.pem < sql/schema.sql>
Note: The previous commands assume you have the MariaDB client installed, the relative locations of schema.sql and the skysql_chain.pem file residing in a directory called Downloads
. But all things are configurable :)
The script will create the following tables within a database called demo
:
supers
teams
supersteams
Load the data
Once the database and tables have been created, execute the data.sql script to load data into the tables.
$ mariadb < sql/data.sql
Getting started with Apache Zeppelin
Adding a MariaDB interpreter <a name="add-interpreter>
For a more comprehensive step-by-step walk-through of how to setup and use Zeppelin with MariaDB check out this blog post!
After you've downloaded and installed Apache Zeppelin you will need to add a new interpreter for MariaDB using the following steps:
- Navigate to "Interpreter".
-
Click the "Create" button.
-
Enter a name for the interpreter and select an "Interpreter group" of
jdbc
.
-
Assign value of org.mariadb.jdbc.Driver to
default.driver
. -
Assign value of jdbc:mariadb://<database_address>/ (where <database_address> is the location of your MariaDB database instance) to
default.url
. -
Assign value to
default.user
. -
Assign value to
default.password
. -
Add the location of the JDBC driver as an artifact.
Importing notes
In Zeppelin, a notebook is simply a collection of notes, which is a collection of “paragraphs”. Each paragraph then uses an interpreter (via MariaDB Connector/J) to connect to and communicate with a datasource (MariaDB).
This repo contains several notes that demonstrate a variety of modern SQL capabilities within MariaDB.
- demo_1, demo_4: Set operators, table value constructors, aggregation functions, and rollups.
- demo_2, demo_5: Window functions and common table expressions (recursive).
- demo_3, demo_6: Temporal tables.
- bitemporal-table-demo: A comprehensive look at a MariaDB Bitemporal table.
Notes can be imported into Zeppelin by clicking the "Import Note" button, and providing a valid json
note file.
Raw Queires
If you'd prefer to execute the SQL queries contained within the Apache Zeppelin you can find them all within demos.sql.
Support and Contribution
Please feel free to submit PR's, issues or requests to this project project directly.
If you have any other questions, comments, or looking for more information on MariaDB please check out:
Or reach out to us diretly via: