Code reusability is the holy grail of software development. Cascading renders itself beautifully to this concept. In Cascading it is relatively simple to create basic building blocks out of pipe assemblies. These building blocks are known as pipe subassemblies, which you can organize into libraries. You then pick and choose these subassemblies to create your own custom "brewery."
Cascading also generously provides us with many built-in subassemblies described in the following sections.
These are the built-in subassemblies:
Coerce
:cascading.pipe.assembly.Coerce
. We briefly touched on coercing fields of one type into another type in Chapter 2, Cascading Basics in Detail. Cascading provides a built-in subassembly to do this. Using this subassembly, you can coerce fields of one type into another within a pipe assembly. For example, the following code will convert theString
fieldtimestamp
intolong
:pipe = new Coerce(pipe, new Fields("timestamp...