Skip to content

hercynium/Hadoop-HiveCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Hadoop::HiveCLI - Run hive CLI processes with a given configuration

VERSION

version 0.001

SYNOPSIS

my $hive = Cmd::HiveRunner->new(
  user => 'sscaffid',
  conf => { foo => 'bar' }
);

# confs are merged, with conf in run getting precedence.
my $job = $hive->run(
  conf  => { 'mapred.job.queue.name' => 'default' },
  query => q{select * from t_location LIMIT 5},
);

# if you want to run things synchronously, just do this.
$job->wait;

DESCRIPTION

This is a class used to run queries via the Hive CLI, as a specific user and setting things like which mapreduce job queue to use.

Calling new sets up an object with whatever you want your defaults to be, and makes sure the program can find your hive and sudo commands. (sudo is necessary to run jobs as a different user).

Then, you can kick off hive processes by calling run with a query (in HQL), and as that process runs in the background, you can check on the progress, and get other potentially useful info about it.

ATTRIBUTES

sudo_path

The path to the sudo command. Will be auto-detected if not specified.

hive_path

The path to the hive command. Will be auto-detected if not specified.

user

The user under which to run hive. Will use sudo to change users if necessary.

conf

A hash of key => value pairs like would be passed to hive with the -hiveconf option.

METHODS

new

Construct a new HiveRunner object

run

Run the hive CLI with the given settings. Accepted parameters:

user

The user under which to run hive

conf

Conf attributes to add-to or override those set in the object

query

The HQL query you want Hive to run. required

EXTENDS

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests by email to bug-hadoop-hivecli at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hadoop-HiveCLI. You will be automatically notified of any progress on the request by the system.

Source Code

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)

https://github.com/Hercynium/Hadoop-HiveCLI

git clone git://github.com/Hercynium/Hadoop-HiveCLI.git

AUTHOR

Stephen R. Scaffidi <sscaffidi@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Stephen R. Scaffidi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages