sh cca175-problem-5-step-6-sqoop-import.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh cca175-problem-5-step-6-sqoop-import.sh相关的知识,希望对你有一定的参考价值。

// On Terminal window-

sqoop job \
  --create hive_sqoop_job \
  -- import \
  --connect "jdbc:mysql://quickstart.cloudera:3306/retail_db" \
  --username "retail_dba" \
  --password "cloudera" \
  --table products_replica  \
  --check-column product_id \
  --incremental append \
  --last-value 0 \
  --hive-import \
  --hive-table products_hive \
  --hive-database problem5;

// On Hive window:

create database problem5;

use problem5;
create table products_hive (
  product_id int, 
  product_category_id int, 
  product_name string, 
  product_description string, 
  product_price float, 
  product_imaage string,
  product_grade int,  
  product_sentiment string
);

// On Terminal window

sqoop job --exec hive_sqoop_job

// On MySQL window

insert into products_replica 
  values (1378,4,'something 1376','something 2',10.00,'not avaialble',null,'NOT APPLICABLE');
insert into products_replica 
  values (1379,4,'something 1376','something 2',10.00,'not avaialble',null,'NOT APPLICABLE');

// On Terminal Window

sqoop job --exec hive_sqoop_job

// On Hive Window

select * from products_hive;

以上是关于sh cca175-problem-5-step-6-sqoop-import.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh cca175-problem-5-step-1-sqoop-import.sh

sh cca175-problem-5-step-2-sqoop-import.sh

sh cca175-problem-5-step-3-sqoop-import.sh

sh cca175-problem-5-step-4-sqoop-merge.sh

sh cca175-problem-5-step-6-sqoop-import.sh

sh cca175-problem-03-partitioning.sh