메뉴 건너뛰기

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;


번호 제목 날짜 조회 수
347 DB별 JDBC 드라이버 2015.10.02 4154
346 console명령과 API비교 2015.12.21 4632
345 mongodb에서 큰데이타 sort시 오류발생에 대한 해결방법 2015.12.22 4176
344 CDH 5.4.4 버전에서 hive on tez (0.7.0)설치하기 2016.01.14 3370
343 Spark Streaming으로 유실 없는 스트림 처리 인프라 구축하기 2016.03.11 3462
342 CentOS의 서버 5대에 yarn(hadoop 2.7.2)설치하기-ResourceManager HA/HDFS HA포함, JobHistory포함 2016.03.29 4637
341 "java.net.NoRouteToHostException: 호스트로 갈 루트가 없음" 오류시 확인및 조치할 사항 2016.04.01 5809
340 namenode오류 복구시 사용하는 명령 2016.04.01 2851
339 Incompatible clusterIDs오류 원인및 해결방법 2016.04.01 2948
338 Cassandra 3.4(3.10) 설치/설정 (5대로 clustering) 2016.04.11 4342
337 bin/cassandra -f -R로 startup할때 NullPointerException오류가 나면 조치할 내용 2016.04.14 3276
336 Hadoop 완벽 가이드 정리된 링크 2016.04.19 3655
335 Spark 2.1.1 clustering(5대) 설치(YARN기반) 2016.04.22 4958
334 kafka 0.9.0.1 for scala 2.1.1 설치및 테스트 2016.05.02 4051
333 kafka broker기동시 brokerId가 달라서 기동에 실패하는 경우 조치방법 2016.05.02 5188
332 Master rejected startup because clock is out of sync 오류 해결방법 2016.05.03 5067
331 spark-shell실행시 "A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection."오류가 발생하는 경우 해결방법 2016.05.20 2953
330 Spark 1.6.1 설치후 HA구성 2016.05.24 4440
329 spark-env.sh에서 사용할 수있는 항목. 2016.05.24 4288
328 "Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources"오류 발생시 조치사항 2016.05.25 4562
위로