Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: more trivial edits

...

Info
titleVersion 1.2.0

As of Hive 1.2.0, resources can be added and deleted using ivy url of the form ivy://group:module:version?query_string.

  • group - Which module group the module comes from. Translates directly to a Maven groupId or an Ivy Organization. 
  • module - The name of the module to load. Translated directly to a Maven artifactId or an Ivy artifact.
  • version - The version of the module to use. Any version or * (for latest) or an Ivy Range can be used.

Various parameters can be passed in the query_string to configure how and which jars are added to the artifactory. The parameters are in the form of key value pairs separated by '&'.

Usage:

No Format
ADD { FILE[S] | JAR[S] | ARCHIVE[S] } <ivy://org:module:version?key=value&key=value&...> <ivy://org:module:version?key=value&key1=value1&...>*
DELETE { FILE[S] | JAR[S] | ARCHIVE[S] } <ivy://org:module:version> <ivy://org:module:version>*

Also, we can mix <ivyurl> and <filepath> in the same ADD and DELETE commands.

No Format
ADD { FILE[S] | JAR[S] | ARCHIVE[S] } { <ivyurl> | <filepath> } <ivyurl>* <filepath>* 
DELETE { FILE[S] | JAR[S] | ARCHIVE[S] } { <ivyurl> | <filepath> } <ivyurl>* <filepath>*

The different parameters that can be passed are:

  1. exclude: Takes a comma separated value of the form org:module.
  2. transitive: Takes values true or false. Defaults to true. When transitive = true, all the transitive dependencies are downloaded and added to the classpath.
  3. ext: The extension of the file to add. 'jar' by default.
  4. classifier: The maven classifier to resolve by.

Examples:

No Format
hive>ADD JAR ivy://org.apache.pig:pig:0.10.0?exclude=org.apache.hadoop:avro;
hive>ADD JAR ivy://org.apache.pig:pig:0.10.0?exclude=org.apache.hadoop:avro&transitive=false;

The DELETE command will delete the resource and all its transitive dependencies unless some dependencies are shared by other resources. If two resources share a set of transitive dependencies and one of the resource resources is deleted using the delete DELETE syntax, then all the transitive dependencies will be deleted for the resource except the ones which are shared.

Examples:

No Format
hive>ADD JAR ivy://org.apache.pig:pig:0.10.0
hive>ADD JAR ivy://org.apache.pig:pig:0.11.1.15
hive>DELETE JAR ivy://org.apache.pig:pig:0.10.0

if If A is the set containing the transitive dependencies of pig-0.10.0 and B is the set containing the transitive dependencies of pig-0.11.1.15, then after executing the above commands, A-(A intersection B) will be deleted.

See HIVE-9664 for more details.

...