메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 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;


번호 제목 날짜 조회 수
150 A Cluster의 HDFS 디렉토리및 파일을 사용자및 권한 유지 하여 다운 받아서 B Cluster에 넣기 2020.05.06 3940
149 W/F수행후 Logs not available for 1. Aggregation may not to complete. 표시되며 로그내용이 보이지 않은 경우 2020.05.08 4960
148 mysql sqoop작업을 위해서 mysql-connector-java.jar을 추가하는 경우 확실하게 인식시키는 방법 2020.05.11 3747
» [sqoop] mapper를 2이상으로 설정하기 위한 split-by컬럼을 찾을때 유용하게 활용할 수 있는 쿼리 2020.05.13 4667
146 [Sentry]HDFS의 ACL을 Sentry와 연동후 테스트 2020.06.02 4130
145 [oozie] oozie shell action에서 shellscript수행결과의 2개 변수를 decision 액션에서 사용하기 2020.06.05 3790
144 [kudu]테이블 drop이 안되고 timeout이 걸리는 경우 조치 방법 2020.06.08 4123
143 [sap] Error: java.io.IOException: SQLException in nextKeyValue 오류 발생 2020.06.08 4245
142 lombok설치방법 2020.06.20 2603
141 missing block및 관련 파일명 찾는 명령어 2021.02.20 4565
140 impald에서 idle_query_timeout 와 idle_session_timeout 구분 2021.05.20 4803
139 [Kudu] tablet server 혹은 kudu master가 어떤 원인에 의해서 replica가 failed상태인 경우 복구하는 방법 2021.05.24 4508
138 Hive JDBC Connection과 유형별 에러및 필요한 jar파일 2021.05.24 3724
137 impala session type별 표시되는 정보로 구분하는 방법 2021.05.25 3873
136 drop table로 삭제했으나 tablet server에는 여전히 존재하는 테이블 삭제방법 2021.07.09 10808
135 AnalysisException: Incomplatible return type 'DECIMAL(38,0)' and 'DECIMAL(38,5)' of exprs가 발생시 조치 2021.07.26 4229
134 tablet별 disk사용량 확인하는 방법 2021.08.27 3755
133 CM의 Impala->Query tab에서 FINISHED query가 보이지 않는 현상 2021.08.31 4494
132 you are accessing a non-optimized hue please switch to one of the available addresses 2021.10.06 4605
131 TLS/SSl설정시 방법및 참고 사항 2021.10.08 4925
위로