You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Akshay Rai (JIRA)" <ji...@apache.org> on 2015/02/12 07:18:11 UTC

[jira] [Commented] (PIG-4417) Pig's register command should support automatic fetching of jars from repo.

    [ https://issues.apache.org/jira/browse/PIG-4417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14317675#comment-14317675 ] 

Akshay Rai commented on PIG-4417:
---------------------------------

Pig Register Command currently supports 3 types of operations:
# Registering jars present in local system.
# Registering jars present in hdfs.
# Registering a script.

Pig should extend its register support and we assume that the jars can be registered from the following locations.
# Pig register should support downloading and adding jars from repositories like maven. In order to fetch a jar from the artifactory we need to specify the group, artifactId and version of the jar. An exclusion list can also be provided to specify the dependencies which should be excluded.
_Proposed Syntax:_
{code:}REGISTER <ivy://org:module:version> -e <org:module1> <org:module2> ...{code}
The above syntax may require some changes in the grammar. As an alternative we could use, 
{code:}REGISTER <ivy://org:module:version>?exclude=<org:module1>&<org:module2>& ...{code}
Here the query 'exclude=something' tells Pig not to download these modules. 
# We can also provide support for downloading a jar from a url.
_Proposed Syntax:_
{code:}REGISTER <http://url>
REGISTER <https://url>{code}
# Registering a jar present in local system. This is the default functionality already supported by pig where the jar present in the local system will be loaded to the classpath.
_Command_
{code:}REGISTER <local/path/to/jar> 
REGISTER file:///path/to/jar{code}
# Registering a script. This is also a functionality supported by Pig.
_Command_
{code:}REGISTER 'test.py' USING jython as myfuncs;{code}
# Registering a jar present in hdfs. Already supported.
_Command_
{code:}REGISTER hdfs:///path/tojar  (full location URI){code}

The above syntax will help easy parsing using URI.
I would appreciate if someone can comment and give their thoughts on this.

> Pig's register command should support automatic fetching of jars from repo.
> ---------------------------------------------------------------------------
>
>                 Key: PIG-4417
>                 URL: https://issues.apache.org/jira/browse/PIG-4417
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Akshay Rai
>
> Currently Pig's register command takes a local path to a dependency jar . 
> This clutters the local file-system as users may forget to remove this jar later.
> It would be nice if Pig supported a Gradle like notation to download the jar from a repository.
> Ex: At the top of the Pig script a user could add
> register '<group>:<module>:<version>'; 
> It should be backward compatible and should support a local file path if so desired.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)