Reputation: 1827
When importing data from MySQL to Hadoop Hive I need to add additional 'timestamp' field to a new table that Hive creates.
Input: MySQL table fields : Name, e-nmail, address
Output: Hive table fileds : Name, e-nmail, address, timestamp
Questions:
Upvotes: 0
Views: 1669
Reputation: 2725
You can customize the data that you are selecting from the RDBMS by using the --query parameter in Sqoop. Your command might look something like this:
sqoop import \
--connect jdbc:mysql://host:port/db \
--query 'SELECT name, email, address, NOW() AS timestamp FROM table WHERE $CONDITIONS' \
--split-by name \
--hive-import \
--hive-table table \
--target-dir location
Upvotes: 1