This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package UDF; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map.Entry; | |
import java.util.regex.Matcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
2 | |
3 | |
4 | |
1 | |
1 | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Plain Sum | |
B = group A All; | |
C = foreach B generate SUM($1); | |
dump C; | |
-- Group And Sum | |
A = load 'input' as (number:int); | |
B = group A by $0; | |
C = foreach B generate SUM($1); | |
dump C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Load | |
A = load 'input' using PigStorage(','); | |
-- this will generate all columns after the first one | |
B = foreach A generate $1..; | |
--Suppose you need to cast the | |
C = FOREACH A generate (chararray)$0,(int)$1,(int)$2,(chararray)$3,(chararray)$4; | |
dump C; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1|Krishna|23 | |
2|Madhuri|37 | |
3|Kalyan|54 | |
4|Shobhana|50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Navigate to this Folder | |
cd /etc/apt | |
# Edit sources.list file and add the MapR repositories into it. | |
vi sources.list | |
# Add MapR repo entries below | |
deb http://package.mapr.com/releases/v2.1.2/ubuntu/ mapr optional | |
deb http://package.mapr.com/releases/ecosystem/ubuntu binary/ | |
# Update repo | |
sudo apt-get update | |
# install Map-r hadoop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FDQN | |
# Password Less SSH, Disable SELINUX , iptables Off | |
# NTP | |
# yum -y install ntp | |
# wget http://public-repo-1.hortonworks.com/ambari/centos6/1.x/updates/1.5.1/ambari.repo | |
# cp ambari.repo /etc/yum.repos.d | |
# yum install ambari-server | |
# ambari-server setup | |
# ambari-server start | |
# Start Ambari in browser u/n admin , pwd admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |config| | |
config.vm.box = "centos65" | |
config.vm.customize [ | |
"modifyvm", :id, | |
"--memory", "3427" | |
] | |
config.vm.define :hadoop1 do |hadoop1_config| | |
hadoop1_config.vm.network :hostonly, "10.10.0.53" | |
hadoop1_config.vm.host_name = "hdp.hadoop1.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdp.hadoop1.com | |
hdp.hadoop2.com | |
hdp.hadoop3.com |
OlderNewer