20211110

김찬울·2021년 11월 10일
0

ps aux

sqoop import --connect jdbc:mysql://namenode:3306/sqoop --username root --password 1234 --table airport_info -m 1 --target-dir /sqoop/airport_info
비슷해보이는 두 명령어는 차이가 있다.
위의 명령어는 /sqoop/airport_info 위치를 타겟으로 데이터를 저장해두는 것

sqoop import --connect jdbc:mysql://namenode:3306/sqoop --username root --password 1234 --table airport_info -m 1 --hive-import
해당 명령어는 hive에 airport_info테이블을 집어넣겠다는 의미!

sqoop import --connect jdbc:mysql://namenode:3306/sqoop \
--username root \
--password 1234 \
--hive-import \
--create-hive-table \
--hive-table airport \
--query "SELECT * FROM airport_info WHERE airlineKorean = '제주항공'" \
--split-by internationalEddate \
--target-dir /sqoop/airport_tmp \
--delete-target-dir \
-m 1

하이브에 새로운 테이블을 만들고 '제주항공'만 조건에 대해 뽑아서 저장

리눅스

crontab 은 윈도우의 스케줄러하고 같은 것이다.
이를 통해 수명업무를 쉽게 할 수 있다.

profile
코린코린이

0개의 댓글