Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다.
문의사항은 gooper@gooper.com로 메일을
보내주세요.
sqoop에서 mapper를 2이상으로 설정하기 위한 split-by컬럼을 찾을때 유용하게 활용할 수 있는 쿼리
(abctable에서 part_ym='201908'인 데이터를 가지고 test_col이라는 컬럼의 값을 이용하여 10등분하고 그 개수를 확인하는 impala sql임, -1은 마지막 값에 속하는 개수를 의미함)
select tt, count(*) from { select case when bb.lapse1 <= cast(substr(aa.test_col, 5,4) as int) and case(substr(aa.test_col, 5,4) as int) < bb.lapse2 then t when t=10 and bb.lapse2 = cast(substr(aa.test_col, 5,4) as int) then -1 end tt from (select * from dw.abctable where part_ym='201908' aa, (select min_val, max_vl, t, max_val*((t-1)/10) as lapse1, max_val*((t+0)/10) as lapse2 from (select min(cast(substr(test_col, 5,4) as int)) as min_val, max(cast(substr(test_col, 5,4) as int)) as max_val from dw.abctable where part_ym= '201908') a, (select cast(t as int) as t from copy_t where t in ('01','02','03','04','05','06','07','08','09','10')) b ) bb } kk where kk.tt is not null group by kk.tt order by 1;
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
39 | 동일서버에서 LA와 LC동시에 기동하여 테스트 | 총관리자 | 2014.04.01 | 928 |
38 | 다수의 로그 에이전트로 부터 로그를 받아 각각의 파일로 저장하는 방법(interceptor및 multiplexing) | 총관리자 | 2014.04.04 | 4089 |
37 | sqoop 1.4.4 설치및 테스트 | 총관리자 | 2014.04.21 | 3134 |
36 | sqoop export/import등을 할때 driver를 못찾는 오류가 발생하면... | 총관리자 | 2014.05.15 | 867 |
35 | sqoop에서 oracle관련 작업할때 테이블명, 사용자명, DB명은 모두 대문자로 사용할것 | 총관리자 | 2014.05.15 | 1528 |
34 | source의 type을 spooldir로 하는 경우 해당 경로에 파일이 들어오면 파일단위로 전송함 | 총관리자 | 2014.05.20 | 687 |
33 | import 혹은 export할때 hive파일의 default 구분자는 --input-fields-terminated-by " |