hive中行转换成列

python代码

#!/bin/bash
import sys;

if __name__=='__main__':
for line in sys.stdin:
  m=line.strip().split('\t')
  print m[0],'\t','huaxue','\t',m[1]
  print m[0],'\t','shuxue','\t',m[2]
  print m[0],'\t','wuli','\t',m[3]

select transform(name,huaxue,shuxue,wuli) using 'python process.py' as (name,leibie,score) from wxl_t3;

上一篇:Codeforces Beta Round #4 (Div. 2 Only) C. Registration system hash


下一篇:【转】Delphi 文件读写