longgb246的博客


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

  • 公益404

  • 搜索
close
longgb246的博客

例子

发表于 2017-01-22 | 分类于 Hive&Hadoop |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CREATE TABLE dev.tmp_check_sku_20161202
AS
SELECT
a.item_sku_id,
b.sku_id
FROM
(SELECT item_sku_id,dt
FROM
gdm.gdm_m03_item_sku_da
WHERE dt= '2016-10-08'
AND sku_valid_flag=1) A
FULL OUTER JOIN
(SELECT sku_id,dt
FROM gdm.gdm_m08_item_stock_day_sum
WHERE dt= '2016-10-08'
) B
ON a.item_sku_id=b.sku_id
阅读全文 »
longgb246的博客

基本命令

发表于 2017-01-22 | 分类于 Hive&Hadoop |

1、设置动态分区

1
2
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nonstrict;

2、设置最大动态分区

1
2
set hive.exec.max.dynamic.partitions=2000;
set hive.exec.max.dynamic.partitions.pernode=2000;
阅读全文 »
longgb246的博客

virtualenv 模块 虚拟环境

发表于 2017-01-14 | 分类于 Python |

1、安装virtualenv

1
pip install virtualenv

2、进入到某个文件夹

创建纯净python2环境
1
2
3
mkdir workspace
cd workspace
virtualenv python2
阅读全文 »
longgb246的博客

python-dcox 模块 生成Word、docx文件

发表于 2017-01-12 | 分类于 Python |

http://python-docx.readthedocs.io/en/latest/index.html
生成word的利器!

一、快速开始

1
2
from docx import Document
document = Document()
阅读全文 »
longgb246的博客

pickle 模块 序列化

发表于 2017-01-12 | 分类于 Python |

使用pickle模块将数据对象保存到文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pickle
data1 = {'a': [1, 2.0, 3, 4+6j],
'b': ('string', u'Unicode string'),
'c': None}
selfref_list = [1, 2, 3]
selfref_list.append(selfref_list)
output = open('data.pkl', 'wb')
# Pickle dictionary using protocol 0.
pickle.dump(data1, output)
# Pickle the list using the highest protocol available.
pickle.dump(selfref_list, output, -1)
output.close()

阅读全文 »
1…891011
longgb246

longgb246

这个人太懒了,什么都没有留下...

52 日志
9 分类
24 标签
RSS
GitHub 微博 简书 CSDN 经管之家
我的好友
  • 大抹茶君
© 2017 longgb246
由 Hexo 强力驱动
主题 - NexT.Pisces