Connecting Apache Zeppelin to MySQL

zeppelin-mysql-graph

Apache Zeppelin is a fantastic open source web-based notebook. Zeppelin allows users to build and share great looking data visualizations using languages such as Scala, Python, SQL, etc. A common back end for Zeppelin in MySQL. Here are the steps needed to connect Zeppelin a remote MySQL database: Download the MySQL Connector The first thing

read more

SELECT N Percent of Records in MySQL

The ability to select a certain percentage of records from a query or database table can be important when working with lots of data. Luckily this is easy to do in MySQL with the RAND() function and a WHERE clause. RAND() returns a random floating point number between 0 and 1, making it easy to

read more

How to Select a Random Sample of Records in MySQL

The ability to select a random sample of records from query or database table can be important when working with lots of data. Luckily this is easy to do in MySQL with the RAND() function and a WHERE clause. RAND() returns a random floating point value between 0 and 1, making it very easy to

read more

Counting Relationships in Neo4j

When working with different graphs in Neo4j, it is often important to count the number of relationships between different nodes. Below are examples of common relationship counting tasks. The data for these examples can be found here and the script to load this data into Neo4j can be found here. Counting Total Relationships (Edges) MATCH

read more

Delete all Nodes and Relationships in a Neo4j Database

Deleting Nodes and Relationships Deleting all nodes and relationships in a Neo4j database is very simple. Here is an example that does just that: MATCH (n) DETACH DELETE n; The DETACH keyword specifies to remove or “detach” all relationships from a particular node before deletion. If relationships exist on a node at the time deletion

read more

Load a Tab Delimited File into Neo4j

Neo4j is a popular graph database which provides an easy way to import text files using the Cypher query language and a LOAD CSV clause. LOAD CSV by default expects files to be delimited by commas. In order to specify another field delimiter, add FIELDTERMINATOR to the LOAD CSV clause. For example:

The statement

read more

Running Neo4j 3.x on Docker

Neo4j is the world’s leading graph database. Fortunately, Neo Technology publishes official Neo4j Docker images which makes it very easy to get started. Once you have Docker running, simply use the the following command to start running Neo4j in a new container (adjust Neo4j version as necessary):

The -p (or –publish) options above binds

read more

How to Select Random Records in MySQL

The ability to select random records from a table in MySQL can be helpful. Luckily this is easy to do with the RAND() function. RAND() returns a random floating point value between 0 and 1. You can select random records in MySQL by using the RAND() function together with ORDER and LIMIT clauses. Here is

read more

Writing to a Database from Spark

One of the great features of Spark is the variety of data sources it can read from and write to. If you already have a database to write to, connecting to that database and writing data from Spark is fairly simple. This example shows how to write to database that supports JDBC connections. Databases Supporting

read more

Loading Data from a Database into Spark

One of the great features of Spark is the variety of data sources it can read from. Loading data from a database into Spark using JDBC requires 3 major steps. First you need a running database that support JDBC connections. Next you will need to download and use the JDBC driver of that database. Finally

read more