Hive_Hive 의 데이터 모델외부 테이블
5434 단어 빅 데이터데이터 구조 와 알고리즘
외부 테이블 (External Table) - HDFS 에 존재 하 는 데 이 터 를 가리 키 며, Partition - 내부 테이블 과 메타 데이터 의 조직 은 같 지만, 실제 데이터 의 저장 은 비교적 큰 차이 가 있 습 니 다.외부 사촌 조 카 는 데 이 터 를 불 러 오고 표를 만 드 는 과정 이 있 습 니 다. 데이터 창고 디 렉 터 리 로 이동 하지 않 고 외부 데이터 와 링크 만 만 만 듭 니 다.외부 테이블 을 삭제 할 때 이 링크 만 삭제 합 니 다.
1、 txt , HDFS /input 。
2、 hive external_student,location HDFS /input 。 external_student /input 。
3、 。 /input 。
4、 /input 。
5、 。 。
6、 /input 。
7、 。 。 예 를 들 면 다음 과 같다.
(1) 준비 데이터:
student1.txt
1,Tom,M,60,80,96
2,Mary,F,11,22,33
student2.txt
3,Jerry,M,90,11,23
student3.txt
4,Rose,M,78,77,76
5,Mike,F,99,98,98 HDFS 。
# hdfs dfs -ls /
input 。
# hdfs dfs -mkdir /input HDFS
hdfs dfs -put localFileName hdfsFileDir
# hdfs dfs -put student1.txt /input
# hdfs dfs -put student2.txt /input
# hdfs dfs -put student3.txt /input (2) 외부 테이블 만 들 기
create table external_student
(sid int, sname string, gender string, language int, math int, english int)
row format delimited fields terminated by ','
location '/input'; (3) 외부 테이블 조회
select * from external_student; (4) HDFS 의 student 1. txt 삭제
# hdfs dfs -rm /input/student1.txt (5) 외부 테이블 조회
select * from external_student; (6) student 1. txt 를 HDFS input 디 렉 터 리 에 다시 넣 기
# hdfs dfs -put student1.txt /input (7) 외부 테이블 조회
select * from external_student; 다음으로 전송:https://www.cnblogs.com/liupuLearning/p/6323004.html
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
spark 의 2: 원리 소개Google Map/Reduce 를 바탕 으로 이 루어 진 Hadoop 은 개발 자 에 게 map, reduce 원 어 를 제공 하여 병렬 일괄 처리 프로그램 을 매우 간단 하고 아름 답 게 만 들 었 습 니 다.S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.