What are Lambdas in Java?

In general a lambda expression is an anonymous function, which means for some combination of inputs, there is a specific output. In the context of Java, a lambda expression is a kind of anonymous method with a more compact constructor syntax. Lambdas in Java are first class citizens, and can be passed as method parameters

read more

Creating a Simple Kafka Consumer

Apache Kafka is a fault tolerant publish-subscribe streaming platform that lets you process streams of records as they occur. If you haven’t installed Kafka yet, see our Kafka Quickstart Tutorial to get up and running quickly. In this post we will talk about creating a simple Kafka consumer in Java. Kafka Consumer Code The example

read more

Creating a Simple Kafka Producer in Java

apache kafka logo

Apache Kafka is a fault tolerant publish-subscribe streaming platform that lets you process streams of records as they occur. If you haven’t installed Kafka yet, see our Kafka Quickstart Tutorial to get up and running quickly. In this post we discuss how to create a simple Kafka producer in Java. Kafka Producer Java Code The

read more

How to Merge multiple commits in Git

The ability to merge multiple commits in Git is a huge plus. Merging commits requires “rebasing” which will essentially rewrite the project history appending commits onto the last commit (by default) in a different branch, or even to an earlier commit in the same branch. Rebasing can have some damaging effects, so be careful when

read more

How to Decode URLs in Hive

Decoding URLs and strings can be a common task, especially when working with web data. This is easy to do in a language like Java or Python, but what about in Hive? Luckily, this is fairly easy as well. Decoding URLs in Hive with Reflection The first and easiest approach is to use the reflect()

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

The Difference between GUID and UUID

GUID (Global Unique Identifier) and UUID (Universally Unique Identifier) are different implementations of the same idea. GUIDs and UUIDs are used as IDs (to identify) unique objects or records. These are very common in a big data environment where coordinating unique IDs in a central location is difficult to do. For practical considerations and nearly

read more

How to Generate a UUID in Java

UUID stands for Universally Unique Identifier. UUIDs are used as IDs (to identify) unique objects or records. An easy way to generate UUIDs in Java is to use the java.util.UUID class. Different variants and variant-versions exist for UUID objects. The methods of this class generally manipulate the Leach-Salz variant, although the constructors allow the creation

read more

What is a UUID?

UUID stands for Universally Unique Identifier. UUIDs are used as IDs (to identify) unique objects or records. These are very common in a big data environment where coordinating unique IDs in a central location is difficult to do. Most values (if not all) in a UUID are generated randomly (depending on UUID version). UUID Format

read more