问题
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