Sqoop: How to map input column names to different column names in Hive?

 ̄綄美尐妖づ 提交于 2021-01-28 03:16:41

问题


Is there any way to do mapping between input column names and output Hive column names in Sqoop command line or Scoop API?

For example:

Input SQL table:
(Name STRING, Phone INT)

--> need to map into -->

Output Hive table:
(ClientName STRING, PhoneNumber INT)

I have to do this because Hive does not support Unicode in table schema and can not parse Cyrillic column names.


回答1:


You can use a free-form query import (--query option) and say something like

--query 'select Name as ClientName, Phone as PhoneNumber' ...


来源:https://stackoverflow.com/questions/22011886/sqoop-how-to-map-input-column-names-to-different-column-names-in-hive

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!