I have 2 rows like below:
941 78 252 3008 86412 1718502 257796 2223252 292221 45514 114894
980 78 258 3064 88318 1785623 269374 2322408 305467 46305 116970
I want to insert current time stamp while inserting each row. finally in my hive table row should be like below:
941 78 252 3008 86412 1718502 257796 2223252 292221 45514 114894 2014-10-21
980 78 258 3064 88318 1785623 269374 2322408 305467 46305 116970 2014-10-22
Is there any way I can insert timestamp directly into hive without using pig script?
You can use
from_unixtime(unix_timestamp())
while inserting.For example, suppose you have following tables:
Now you can populate table t2 from t1 with current timestamp: