0
votes

To import as400 table to hive partitioned with timestamp. i add two arguments:

--hive-partition-key "time" 

for the name partition column, and for the map partition value:

--hive-partition-value "2018-05-01" 

my question is how to add a query in the hive-partition-value for example:

$timestamp=select now() as timestamp from mytable
--hive-partition-value $timestamp
1

1 Answers

0
votes

Use date command:

 current_date=$(date +%Y-%m-%d)

Then:

sqoop import --hive-partition-key "time" --hive-partition-value "$current_date" ...