메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


hive lateral view 예제

총관리자 2014.09.18 14:36 조회 수 : 691


---------------------------파일내용-------------


1, read a book

2,한글과 컴퓨터 만!~쉐

3,write a book



--------------------hive테이블 생성 --------------------


create external table cmt

(

c_id         int,

c_cont         string

)

row format delimited fields terminated by ','

location '/user/hadoop/input/exp';



-----------------------------cmt테이블내용-----------------


c_id c_conts

1  read a book

2 대한 민국 만!~쉐

3 write a book




----hive query --

select c_id, c_conts from cmt

lateral view explode(split(trim(c_cont),' ')) dummy as c_conts

==>

c_id c_conts

1 read

1 a

1 book

2 한글과

2 컴퓨터

2 만!~쉐

3 write

3 a

3 book

Time taken: 19.293 seconds, Fetched: 9 row(s)


-----------------------쿼리2-----------------

select c_id, c_conts from cmt

lateral view explode(split(c_cont, ' ')) dummy as c_conts

==>

c_id c_conts

1

1 read

1 a

1 book

2 한글과

2 컴퓨터

2 만!~쉐

3 write

3 a

3 book

Time taken: 18.142 seconds, Fetched: 10 row(s)

번호 제목 글쓴이 날짜 조회 수
» lateral view 예제 총관리자 2014.09.18 691
96 root가 localhost에서 mysql로 접근하지 못하는 경우의 해결방법(패스워드) 총관리자 2014.09.10 595
95 mysql 5.5.34-0ubuntu0.13.04용 설치/진행 화면 총관리자 2014.09.10 697
94 apt-get install mysql-server수행시 "404 Not Found" 오류발생시 조치방법 총관리자 2014.09.10 1450
93 banana pi에 hive 0.13.1+mysql(metastore)설치 file 총관리자 2014.09.09 2406
92 원격지에서 zio공유기를 통해서 노트북의 mysql접속을 허용하는 방법 총관리자 2014.09.07 494
91 sqoop작업시 hdfs의 개수보다 더많은 값이 중복되어 oracle에 입력되는 경우가 있음 총관리자 2014.09.02 4093
90 java.util.NoSuchElementException발생시 조치 총관리자 2014.08.27 476
89 hadoop의 data디렉토리를 변경하는 방법 총관리자 2014.08.24 531
88 시스템날짜를 현재 정보로 동기화 하는 방법(rdate, ntpdate이용) 총관리자 2014.08.24 481
87 FAILED: IllegalStateException Variable substitution depth too large: 40 오류발생시 조치사항 총관리자 2014.08.19 1520
86 원보드 컴퓨터 비교표 file 총관리자 2014.08.04 408
85 외부 기기(usb, 하드)등 mount(연결)하기 총관리자 2014.08.03 546
84 데이타 제공 사이트 링크 총관리자 2014.08.03 508
83 lubuntu 호스트 네임변경 총관리자 2014.08.03 601
82 oozie 에서 sqoop action실행 에러 - 컬럼개수 차이 총관리자 2014.07.17 1002
81 uEnv.txt위치및 내용 총관리자 2014.07.09 643
80 banana pi(lubuntu)에서 한글 설정및 한글깨짐 문제 해결 총관리자 2014.07.06 3204
79 access=WRITE, inode="staging":ubuntu:supergroup:rwxr-xr-x 오류 총관리자 2014.07.05 1719
78 org.apache.hadoop.security.AccessControlException: Permission denied: user=hadoop, access=WRITE, inode="":root:supergroup:rwxr-xr-x 오류 처리방법 총관리자 2014.07.05 2833

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로