sqoop支持通过蜂巢进行动态分区吗? [英] does sqoop support dynamic partitioning with hive?
问题描述
sqoop是否支持通过蜂巢进行动态分区? 我尝试使用以下提到的选项: --hive-partition-key和--hive = partition-vlaue仅用于静态分区
does sqoop support dynamic partitioning with hive? i tried using below-mentioned options : --hive-partition-key and --hive=partition-vlaue is only for static partitioning
例如: sqoop导入 --connect"jdbc:mysql://quickstart.cloudera:3306/prac" --username root-密码cloudera --hive-import --query从城市='孟买'和\ $ CONDITIONS的学生中选择ID,名称,ts --hive-partition-关键城市 --hive-partition-value'孟买' --hive-table实践 --target-dir/user/mangesh/sqoop_import/student_temp5 --split-by id
for eg: sqoop import --connect "jdbc:mysql://quickstart.cloudera:3306/prac" --username root --password cloudera --hive-import --query "select id,name,ts from student where city='Mumbai' and \$CONDITIONS " --hive-partition-key city --hive-partition-value 'Mumbai' --hive-table prac.student --target-dir /user/mangesh/sqoop_import/student_temp5 --split-by id
推荐答案
您可以使用hcatalog导入-您需要sqoop 1.4.4才能做到这一点.
You can use hcatalog imports - you need sqoop 1.4.4 to do this.
sqoop import \
--connect "jdbc:oracle:SERVERDETAILS" \
--username <User Name>\
--password <Password> \
--table <Databse.Tablename> \
--fields-terminated-by ',' \
--split-by <Column Name> \
--hcatalog-database <Hive DatabseName>
--hcatalog-table <Hive Table Name>
有关更多详细信息,请通过
For more details please go through
http://sqoop.apache.org/docs/1.4 .4/SqoopUserGuide.html#_sqoop_hcatalog_integration
这篇关于sqoop支持通过蜂巢进行动态分区吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!