在oracle数据库里面,有两个业务表格: select * from guangzhou_sales_2; select * from shenzhen_sales_2; 现在要用SQOOP将两个业务表汇总到Hive数据库的总表中。
时间: 2023-12-10 13:38:03 浏览: 30
可以使用以下命令将两个业务表格汇总到Hive数据库的总表中:
```
sqoop import \
--connect jdbc:oracle:thin:@//<IP_Address>:<Port>/<Service_Name> \
--username <username> \
--password <password> \
--table guangzhou_sales_2 \
--hive-import \
--hive-table <hive_table_name> \
--target-dir <target_directory> \
--fields-terminated-by ','
sqoop import \
--connect jdbc:oracle:thin:@//<IP_Address>:<Port>/<Service_Name> \
--username <username> \
--password <password> \
--table shenzhen_sales_2 \
--hive-import \
--hive-table <hive_table_name> \
--target-dir <target_directory> \
--fields-terminated-by ','
```
其中,<IP_Address>是Oracle数据库的IP地址,<Port>是Oracle数据库的端口号,<Service_Name>是Oracle数据库的服务名称,<username>和<password>是Oracle数据库的用户名和密码,<hive_table_name>是在Hive数据库中创建的总表名称,<target_directory>是存储导入数据的目标目录。
这两个命令将会把guangzhou_sales_2和shenzhen_sales_2表格中的数据导入到Hive数据库的总表中,使用","作为字段分隔符。
相关推荐
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)