Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Hive creates tables and imports data through Sqoop in transwarp environment

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "create tables in transwarp environment and import data through Sqoop", the content of the explanation is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "transwarp environment Hive create tables and import data through Sqoop" bar!

/ / the first step is to import the data from oracle into hdfs before executing the import command, you need to create the log file directory / root/nantong_out/ and the hdfs import file directory / jssdatas/nantong/, where the / e_mp_cur_curve directory will be created automatically in the import statement, not separately.

Nohup sqoop import-- connect jdbc:oracle:thin:@192.168.2.155:1521:orcl-- username nantong-- password nantong123-- fetch-size 1000-M1-- target-dir / jssdatas/nantong/e_mp_cur_curve/-- query "select * from e_mp_cur_curve where\ $CONDITIONS"-- fields-terminated-by'\ 001'& > / root/nantong_out/e_mp_cur_curve.out &

/ / the second step is to create a table and associate the table with the data file. Use databasename will use which database will build the table under which database. When the table is built, the corresponding data file will be specified, so that the data can be associated.

Create external table e_mp_cur_curve (id string,data_date string,phase_flag int,data_whole_flag string,data_point_flag int,i1 double,i2 double,i3 double,i4 double,i5 double,i6 double,i7 double,i8 double,i9 double,i10 double,i11 double,i12 double,i13 double,i14 double,i15 double,i16 double,i17 double,i18 double,i19 double,i20 double,i21 double,i22 double,i23 double,i24 double,i25 double,i26 double,i27 double,i28 double,i29 double,i30 double,i31 double I32 double,i33 double,i34 double,i35 double,i36 double,i37 double,i38 double,i39 double,i40 double,i41 double,i42 double,i43 double,i44 double,i45 double,i46 double,i47 double,i48 double,i49 double,i50 double,i51 double,i52 double,i53 double,i54 double,i55 double,i56 double,i57 double,i58 double,i59 double,i60 double,i61 double,i62 double,i63 double,i64 double,i65 double,i66 double,i67 double,i68 double,i69 double,i70 double,i71 double,i72 double,i73 double,i74 double,i75 double I76 double,i77 double,i78 double,i79 double,i80 double,i81 double,i82 double,i83 double,i84 double,i85 double,i86 double,i87 double,i88 double,i89 double,i90 double,i91 double,i92 double,i93 double,i94 double,i95 double,i96 double) row format delimited fields terminated by'\ 001' lines terminated by'\ n 'location' / jssdatas/nantong/e_mp_cur_curve'

/ / create file directory command (if the ordinary file directory command does not have permission, follow below)

Sudo-u hdfs hdfs dfs-mkdir / jssdatas/nantong/e_mp_cur_curve / / create

Sudo-u hdfs hdfs dfs-chmod / jssdatas/nantong/e_mp_cur_curve / / Grant permission

Sudo-u hdfs hdfs dfs-ls / jssdatas/nantong/e_mp_cur_curve / / View

Sudo-u hdfs hdfs dfs-rm-R / jssdatas/nantong/e_mp_cur_curve / / delete

Sudo-u hdfs hdfs dfs-chown hive:hadoop / jssdatas/nantong/e_mp_cur_curve / / assign permissions to a user

/ / normal file directory command

Hdfs dfs-mkdir / jssdatas/nantong/e_mp_cur_curve / / create

Hdfs dfs-chmod / jssdatas/nantong/e_mp_cur_curve / / Grant permission

Hdfs dfs-ls / jssdatas/nantong/e_mp_cur_curve / / View

Hdfs dfs-rm-R / jssdatas/nantong/e_mp_cur_curve / / delete

Thank you for your reading, the above is the content of "creating tables in transwarp and importing data through Sqoop". After the study of this article, I believe you have a deeper understanding of the problem of creating tables in transwarp and importing data through Sqoop, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report