메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

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


MariaDB의 study데이타 베이스에 접근하여 product테이블의 데이타를 가져와서 study/out/productimport에 저장하는 sqoop문장이다.
이때 컬럼구분자는 '\001'(^A)를 사용하고 라인구분자는 '\003'(^C)를 사용한다.
hive폴더에 저장되는 라인은 price >1인 조건을 만족해야하며 productID및 name만 저장된다
이렇게 하면 컬럼에 newline(\n)이 있어도 문제없이 가져올 수 있다.

sqoop import \
--connect=jdbc:mysql://gsda3:포트/study \
--username=db사용자\
--password=패스워드\
--table=product \
--target-dir=study/out/productimport \
--fields-terminated-by='\001' \
--lines-terminated-by='\003'
--where="price > 1 " \
--columns="productID, name"

아래는 위에서 sqoop로 가져온 데이타에 대한 external table을 생성하는 hive명령문이다.

hive 1.1에서 기본적으로 지원하는 라인 구분자는 '\n'만 지원한다.
하지만 textinputformat.record.delimiter을 이용하여 라인 구분자를 변경할 수 있다.

set textinputformat.record.delimiter='\003';
create external table productimport
(productID string, name string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
STORED AS TEXTFILE
LOCATION 'study/out/productimport';
번호 제목 글쓴이 날짜 조회 수
561 Query Status: Sender xxx.xxx.xxx.xxx timed out waiting for receiver fragment instance: 1234:cdsf, dest node: 10 의 오류 원인및 대응방안 총관리자 2021.11.03 77
560 파일끝에 붙는 ^M 일괄 지우기(linux, unix(AIX)) 혹은 파일내에 있는 ^M지우기 총관리자 2016.09.24 78
559 Components of the Impala Server 총관리자 2018.03.21 78
558 LAGOM 1.4 AND KUBERNETES ORCHESTRATION 총관리자 2019.07.19 78
557 로컬에 있는 jar파일을 지정하고 dependency로 가져오기 총관리자 2016.08.19 79
556 다중 모듈 프로젝트 설정에 대한 설명 총관리자 2016.09.21 80
555 python3.5에서 numpy버젼에 따른 문제점을 조치하는 방법및 pymysql import할때 오류 발생시 조치사항 총관리자 2017.09.28 80
554 외부 jar파일을 만들려고하는jar파일의 package로 포함하는 방법 총관리자 2016.08.10 81
553 oneM2M Specification(Draft Release 3, 2, 1), Draft Technical Reports 총관리자 2017.10.25 81
552 Lagom에서 제공하는 Maven을 이용한 Hello프로젝트 자동생성 및 실행 총관리자 2018.01.19 81
551 Query 1234:1234 expired due to client inactivity(timeout is 5m)및 invalid query handle gooper 2022.06.10 81
550 jena의 data폴더를 hadoop nfs를 이용하여 HDFS상의 폴더에 마운트 시키고 fuseki를 통하여 inert를 시도했을때 transaction 오류 발생 총관리자 2016.12.02 82
549 TLS/SSl설정시 방법및 참고 사항 총관리자 2021.10.08 83
548 Hue Job Browser의 Queries탭에서 조건을 지정하는 방법 총관리자 2018.05.10 84
547 각 서버에 설치되는 cloudera서비스 프로그램 목록(CDH 5.14.0의 경우) 총관리자 2018.03.29 85
546 kudu rebalance수행 command예시 총관리자 2022.01.17 85
545 HBase write 성능 튜닝 file 총관리자 2017.07.18 87
544 collection생성시 -shards와 -replicationFactor값을 잘못지정하면 write.lock for client xxx.xxx.xxx.xxx already exists오류가 발생한다. 총관리자 2016.04.28 88
543 MongoDB에 있는 특정컬럼의 값을 casting(string->integer)하여 update하기 java 소스 총관리자 2016.12.19 88
542 http://blog.naver.com... 총관리자 2017.06.23 88

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.

위로