- Pig Design Patterns
- Pradeep Pasupuleti
- 208字
- 2021-07-16 12:07:57
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are a few examples of these styles and an explanation of their meaning.
Code words in text are shown as follows: "From this point onward, we shall call the unpacked Hadoop directory HADOOP_HOME
."
A block of code for UDFs written in Java is set as follows:
package com.pigdesignpatterns.myudfs; public class DeIdentifyUDF extends EvalFunc<String> { @Override public String exec(Tuple input){ try { String plainText = (String)input.get(0); String encryptKey = (String)input.get(1); String str=""; str = encrypt(plainText,encryptKey.getBytes()); return str; } catch (NullPointerException npe) { warn(npe.toString(), PigWarning.UDF_WARNING_2); return null; } catch (StringIndexOutOfBoundsException npe) { warn(npe.toString(), PigWarning.UDF_WARNING_3); return null; } catch (ClassCastException e) { warn(e.toString(), PigWarning.UDF_WARNING_4); return null; }
Pig Script is displayed as follows:
Users = load 'users' as (name, age); Fltrd = filter Users by age >= 18 and age <= 25; Pages = load 'pages' as (user, url); Jnd = join Fltrd by name, Pages by user; Grpd = group Jnd by url; Smmd = foreach Grpd generate group, COUNT(Jnd) as clicks; Srtd = order Smmd by clicks desc; Top5 = limit Srtd 5; store Top5 into 'top5sites'
Any command-line input or output is written as follows:
>tar -zxvf hadoop-1.x.x.tar.gz
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Clicking the Next button moves you to the next screen."
推薦閱讀
- Mastering Spark for Data Science
- Mastering D3.js
- 80x86/Pentium微型計算機原理及應用
- JSF2和RichFaces4使用指南
- Hybrid Cloud for Architects
- Blender 3D Printing by Example
- DevOps Bootcamp
- Applied Data Visualization with R and ggplot2
- 零起點學西門子S7-200 PLC
- Photoshop CS5圖像處理入門、進階與提高
- 單片機技術項目化原理與實訓
- Learn QGIS
- PostgreSQL 10 High Performance
- 天才與算法:人腦與AI的數學思維
- 新世紀Photoshop CS6中文版應用教程