Certificação Hortonworks Hadoop FS – Certificação HDP hortonworks

Simulado da prova de certificação HDP Hortonworks

TAREFA 10

Exportando com Sqoop

  1. Coloque o arquivo local /home/hortonworks/datasets/flightdelays/sfo_weather.csv no HDFS em um novo diretório chamado /user/hortonworks/weather/
  2. Note que existe uma base de dados MySQL chamada flightinfo na máquina namenode, contendo uma tabela chamada weather com o esquema mostrado na tabela mostrada abaixo.
  3. Use o Sqoop para exportar o diretório weather no HDFS para a tabela weather no MySQL na porta 3306 na máquina namenode(HDFS). O nome de usuário do MySQL é root e a senha é hadoop.
Esquema da tabela weather
Field Type Null Key Default Extra
station varchar(100) YES NULL
year int(11) YES NULL
month int(11) YES NULL
dayofmonth int(11) YES NULL
precipitation int(11) YES NULL
maxtemp int(11) YES NULL
mintemp int(11) YES NULL

 

Script

hadoop fs -put /home/horton/datasets/flightdelays/sfo_weather.csv /user/horton/weather/

sqoop export 
--connect jdbc:mysql://namenode/flightinfo 
--table weather 
--export-dir /user/horton/weather 
--input-fields-terminated-by ',' 
--username root 
--password hadoop

Obrigado

Até a próxima

Aula 12 – Tarefa 10 do simulado da prova de certificação HDP Hortonworks

| Big Data - Data Science - Machine Learning, Certificação Hortonworks Hadoop | 0 Comments
About The Author
-

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>