Introduction to Java Streams

What are Java Streams? A Java stream is a sequence of elements of a specific type that are consumed from a source like Collections, arrays, or I/O resources. Streams are similar to collections in that they can both be used to process and aggregate data. However, there are some big differences. Although the idea of

read more

How to Uppercase/Lowercase text with sed

sed is a common Linux/Unix utility used to parse and transform text. Below are examples of uppercasing and lowercasing text with sed: Uppercasing Text with sed

[a-z] is the regular expression which will match lowercase letters. \U& is used to replace these lowercase letters with the uppercase version. Lowercasing Text with sed

[A-Z]

read more

Convert JSON to TSV with jq

jq is a lightweight JSON command line processor that makes many JSON processing tasks very easy. A common task when working with JSON is to convert records into a TSV (tab delimited) format. Below are examples of how to convert JSON to TSV with jq. Converting JSON to TSV In order to convert JSON to

read more

Convert JSON to CSV with jq

jq is a lightweight JSON command line processor that makes many JSON processing tasks very easy. A common task when working with JSON is to convert records into a CSV format. Below are examples of how to convert JSON to CSV with jq. Converting JSON to CSV In order to convert JSON to CSV with

read more

What is the Java Supplier Interface?

The Java Supplier interface of the java.util.function package is a functional interface that is often used as an assignment target for lambda expressions. The get() method is the class’s only abstract method, which takes no input and returns an output. For more information on functional interfaces in Java click here: What is a Java Functional

read more

What is the Java Function Interface?

The Java Function interface of the java.util.function package is a functional interface that is often used as an assignment target for lambda expressions. The apply(T t) method is the class’s only abstract method, leaving it as the only one without a default implementation. Here is an overview of the various methods in the Function interface:

read more

What is the Java Predicate Interface?

The Java Predicate interface of the java.util.function package is a functional interface that is often used as an assignment target for lambda expressions.  The test(T t) method is the class’s only abstract method, leaving it as the only one without a default implementation.  Here is an overview of the various methods in the Predicate interface:

read more

What is Predicate Pushdown?

The basic idea of predicate pushdown is that certain parts of SQL queries (the predicates) can be “pushed” to where the data lives.  This optimization can drastically reduce query/processing time by filtering out data earlier rather than later. Depending on the processing framework, predicate pushdown can optimize your query by doing things like filtering data

read more

What is the Java Consumer Interface?

The Java Consumer interface of the java.util.function package is a functional interface that is often used as an assignment target for lambda expressions. accept(T t) is the interface’s single abstract method which takes an object as input and returns nothing. The andThen(Consumer<? super T> after) method provides a simple way to string multiple Consumer objects

read more

What is a Java Functional Interface?

Simply put, a Java functional interface is an interface with a single abstract method. Functional interfaces were released with Java 8 and provide target types for lambda expressions. The java.util.function package contains various general purpose functional interfaces such as Predicate, Consumer, Function, and Supplier. For an an intro to Java lambda expressions click here: What

read more