[hive] 다이나믹 파티션의 __HIVE_DEFAULT_PARTITION__

2017. 2. 2. 17:48·빅데이터/hive

하이브에서 다이나믹 파티션으로 데이터를 생성할 때 

다이나믹 파티션에 입력되는 이름이 null 이거나 공백이면 

하이브에서 지정된(hive.exec.default.partition.name) 이름을 이용하여 파티션을 생성한다. 


hive-default.xml 에 설정된 기본 이름이 __HIVE_DEFAULT_PARTITION__이다. 


아래와 같은 코드에서 country_code 칼럼에 공백이나 null 값이 있으면 

기본으로 설정된 이름의 파티션이 생성된다. 


insert into table partition_sample partition (country_code)

select country, 

       country_code 

  from world_name;



show partitions partition_sample ;

...

country_code=__HIVE_DEFAULT_PARTITION__


  • If the input column value is NULL or empty string, the row will be put into a special partition, whose name is controlled by the hive parameter hive.exec.default.partition.name. The default value is HIVE_DEFAULT_PARTITION{}. Basically this partition will contain all "bad" rows whose value are not valid partition names. The caveat of this approach is that the bad value will be lost and is replaced by HIVE_DEFAULT_PARTITION{} if you select them Hive. JIRA HIVE-1309 is a solution to let user specify "bad file" to retain the input partition column values as well.
  • Dynamic partition insert could potentially be a resource hog in that it could generate a large number of partitions in a short time. To get yourself buckled, we define three parameters:
    • hive.exec.max.dynamic.partitions.pernode (default value being 100) is the maximum dynamic partitions that can be created by each mapper or reducer. If one mapper or reducer created more than that the threshold, a fatal error will be raised from the mapper/reducer (through counter) and the whole job will be killed.
    • hive.exec.max.dynamic.partitions (default value being 1000) is the total number of dynamic partitions could be created by one DML. If each mapper/reducer did not exceed the limit but the total number of dynamic partitions does, then an exception is raised at the end of the job before the intermediate data are moved to the final destination.
    • hive.exec.max.created.files (default value being 100000) is the maximum total number of files created by all mappers and reducers. This is implemented by updating a Hadoop counter by each mapper/reducer whenever a new file is created. If the total number is exceeding hive.exec.max.created.files, a fatal error will be thrown and the job will be killed.



hive 설정 - https://svn.apache.org/repos/asf/hive/tags/release-0.6.0/conf/hive-default.xml

hive 튜토리얼 - https://cwiki.apache.org/confluence/display/Hive/Tutorial


반응형
저작자표시 비영리 (새창열림)

'빅데이터 > hive' 카테고리의 다른 글

[hive] order by, sort by, cluster by 의 차이  (0) 2017.02.14
[hive][tez] tez 처리중 tez.lib.uris is not defined in the configuration 오류 수정  (0) 2017.02.07
[Hive] transform 으로 파이썬을 이용할 때 exception 출력하기  (0) 2017.01.23
[Hive] TRANSFORM()을 이용하여 입력데이터 변형(custom mapreduce 사용하기)  (0) 2017.01.23
[hive] desc 명령을 이용하여 하이브 테이블, 파티션의 로케이션 확인하기  (0) 2017.01.19
'빅데이터/hive' 카테고리의 다른 글
  • [hive] order by, sort by, cluster by 의 차이
  • [hive][tez] tez 처리중 tez.lib.uris is not defined in the configuration 오류 수정
  • [Hive] transform 으로 파이썬을 이용할 때 exception 출력하기
  • [Hive] TRANSFORM()을 이용하여 입력데이터 변형(custom mapreduce 사용하기)
hs_seo
hs_seo
Hello World!
    반응형
  • hs_seo
    개발자로 살아남기
    hs_seo
  • 전체
    오늘
    어제
    • 전체 (1140)
      • 개발자 (21)
        • 개발에 유의할 점 (0)
        • 면접 (5)
      • IT 소식 (5)
        • 업계 (1)
      • java (51)
        • 디자인패턴 (3)
        • apache-common (1)
      • 개념 (47)
        • 자료구조 (4)
        • 함수형사고 (8)
        • 디자인패턴 (1)
      • 데이터분석 (1)
      • python (67)
        • 코드조각 (12)
        • 라이브러리 (2)
      • 빅데이터 (418)
        • zookeeper (5)
        • hadoop (78)
        • hdfs (12)
        • hive (127)
        • hbase (16)
        • spark (40)
        • scala (4)
        • trino (3)
        • oozie (41)
        • Hue (9)
        • R (5)
        • sqoop (6)
        • flume (3)
        • elasticsearch (2)
        • airflow (16)
        • kafka (3)
        • kubernetes (10)
        • openstack (3)
        • flink (2)
        • redis (2)
      • 빅데이터 강좌 (2)
      • 알고리즘 (131)
        • 알고리즘 (1)
        • 백준 (61)
        • 정올 (41)
        • 더블릿 (5)
        • 프로그래머스 (1)
      • 프로그래밍 언어 (30)
        • go (4)
        • js (9)
        • .Net (6)
        • Jsp (1)
        • ansible (3)
        • terraform (6)
      • Tools (56)
        • docker (2)
        • macbook (6)
        • maven (3)
        • sublime (1)
      • 프레임워크 (25)
        • [JS] angularjs (2)
        • [JS] node.js (19)
        • [Java] spring (2)
        • Android (2)
      • 데이타베이스 (43)
        • SQLD (5)
        • Oracle (1)
        • MySQL (8)
        • ADsP (2)
      • 리눅스 (25)
        • Bash (61)
      • GCP (5)
      • AWS (34)
        • EC2 (2)
        • EMR (14)
      • 정보보안기사 (4)
        • 네트워크 (1)
      • 개인 (80)
        • 업무실수 (0)
        • 책 (9)
        • 교육 (3)
        • 여행 (17)
        • 영화 (12)
        • 음악 (2)
        • 피규어 (4)
        • 게임 (3)
        • 생각 (7)
        • 기타 (10)
        • 좋은글 (5)
        • 좋은 사이트 (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

    • 빅데이터-하둡,하이브로 시작하기
    • 빅데이터-스칼라, 스파크로 시작하기
    • Kaggle에서 파이썬으로 데이터 분석 시작하기
    • 쉘스크립트 개발 시작하기
    • 개발자가 데이터 분석 준전문가 되기
    • 데브쿠마
  • 공지사항

  • 인기 글

  • 태그

    HDFS
    다이나믹
    백준
    Tez
    Python
    알고리즘
    Hadoop
    ubuntu
    nodejs
    오류
    파이썬
    hbase
    mysql
    S3
    정올
    하이브
    yarn
    emr
    error
    build
    java
    SPARK
    하둡
    bash
    Linux
    oozie
    k8s
    airflow
    HIVE
    AWS
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.6
hs_seo
[hive] 다이나믹 파티션의 __HIVE_DEFAULT_PARTITION__
상단으로

티스토리툴바