Skip to content

Instantly share code, notes, and snippets.

@evidanary
Created July 17, 2014 18:33
Show Gist options
  • Save evidanary/593b6c3039545ab73f8f to your computer and use it in GitHub Desktop.
Save evidanary/593b6c3039545ab73f8f to your computer and use it in GitHub Desktop.
Hive Last modification time of a table using webhdfs gem
irb> require 'webhdfs'
irb> client = WebHDFS::Client.new('hadoop-nn', 50070)
irb> fl = client.list('/user/hive/warehouse/database.db/tablename/')
irb> DateTime.strptime(fl.collect {|x| x['modificationTime']}.max.to_s, '%M')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment