Skip to content

Instantly share code, notes, and snippets.

@dallasmarlow
Created January 15, 2014 02:49
Show Gist options
  • Save dallasmarlow/8429927 to your computer and use it in GitHub Desktop.
Save dallasmarlow/8429927 to your computer and use it in GitHub Desktop.
completed sqoops
require 'hdfs/classpath'
require 'uri'
hdfs = Hadoop::DFS::FileSystem.new host: options[:namenode]
hdfs.list_directory(options[:import_path]).reject do |entry|
hdfs.list_directory(URI.parse(entry.name).path).find do |entry|
URI.parse(entry.name).path.end_with?('_SUCCESS')
end
end.map do |entry|
URI.parse(entry.name).path.split('/').last
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment