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
hive> SELECT | |
> `dim_pay_date`.`date` | |
> , `deal`.`dealid` | |
> FROM `orderpayment_small` `orderpayment` | |
> JOIN `orderpayment_small` `dim_pay_date` ON `dim_pay_date`.`date` = `orderpayment`.`date` | |
> JOIN `orderpayment_small` `deal` ON `deal`.`dealid` = `orderpayment`.`dealid` | |
> JOIN `orderpayment_small` `order_city` ON `order_city`.`cityid` = `orderpayment`.`cityid` | |
> JOIN `user_small` `user` ON `user`.`userid` = `orderpayment`.`userid` | |
> limit 5; | |
Total MapReduce jobs = 4 |
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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: dump_sw_java.sh <keyword>" | |
fi | |
DUMPDIR=dump_dir | |
keyword=$1 | |
ts=$(date +%H%M%S.%N) |
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
env LC_CTYPE=C tr -dc "a-zA-Z0-9-_\$\?" < /dev/urandom | head -c 10 |
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
import os | |
import imp | |
WORKDIR = os.path.dirname(os.path.abspath(__file__)) | |
path = lambda *a: os.path.join(WORKDIR, *a) | |
importer = lambda m, path: imp.load_module(m, *imp.find_module(m, [path])) | |
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
gsh --hosts-file=hosts |
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
#http://stackoverflow.com/questions/15105135/bash-capturing-output-of-awk-into-array | |
lists=("http://www.youtube.com/watch?v=tKTZoB2Vjuk" | |
"http://www.youtube.com/watch?v=EPYupizJYQI" | |
"http://www.youtube.com/watch?v=haycL41dAhg" | |
"http://www.youtube.com/watch?v=kWyoYtvJpe4" | |
"http://www.youtube.com/watch?v=uKZ8GBKmeDM" | |
"http://www.youtube.com/watch?v=Nn2KQmVF5Og" | |
"http://www.youtube.com/watch?v=IcteAbMC1Ok"); |
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
#http://mapredit.blogspot.com/2013/05/get-all-extended-hive-tables-with.html | |
for file in $(hive -e "show table extended like \`*\`" | grep location: | awk 'BEGIN { FS = ":" };{printf("hdfs:%s:%s\n",$3,$4)}'); do hdfs dfs -du -h $file; done; |
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
http://stackoverflow.com/questions/11409518/how-to-remove-last-6-characters-of-every-line-in-vim |
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
#coding=utf8 | |
read_ints = lambda: map(int, raw_input().split()) | |
#先假设没有正负号 | |
# 1 + (12 + 4) | |
# 提高, 有正负号怎么办呢? | |
#((1+2)*(-333+4)+1) * (-5) | |
# 1 * -5 |
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
python gen_task_assignment_conf.py -m 10 -s 60 --hosts $hosts --ports $ports |
OlderNewer