pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Gates (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream
Date Mon, 03 Jan 2011 22:00:49 GMT

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

Alan Gates commented on PIG-1675:
---------------------------------

+1 on the latest patch, changes look good.  

To comment on the interface changes.  I agree that PigServer is growing too many methods.
 The new Pig class proposed as part of the embedding in scripting languages will make this
even worse.  (See PIG-1479.)  My hope was actually to move eventually to that and deprecate
PigServer altogether.  That way we will have one (hopefully) coherent interface to Pig regardless
of whether the user is coming from Java or a scripting language.

As far as whether we can change PigServer even though it's stable, we can.  We just can't
do it in a non-backward compatible way between major (x.0) releases.  We haven't had a 1.0
yet, but I have been taking that to mean we can mark methods as deprecated, we just can't
remove them.


> Suggest to allow PigServer can register pig script from InputStream
> -------------------------------------------------------------------
>
>                 Key: PIG-1675
>                 URL: https://issues.apache.org/jira/browse/PIG-1675
>             Project: Pig
>          Issue Type: Improvement
>    Affects Versions: 0.8.0
>            Reporter: Jeff Zhang
>            Assignee: Jeff Zhang
>             Fix For: 0.9.0
>
>         Attachments: pig-findbugs-report.html, PIG_1675.patch, PIG_1675_2.patch, PIG_1675_3.patch,
PIG_1675_4.patch
>
>
> Currently, Pig only allow users to register script from file. Although it satisfy most
people's requirements, sometimes people hope to build pig script dynamically using code, then
they need to create temp file for the script they build. So here I suggest to allow PigServer
be able to register pig script from InputStream.
> InputStream is a more general type than File, pig script can been from file (FileInputStream)
> or from in-memory (ByteArrayInputStream) even it can been from remote machines (SocketInputStream)
> Here's a blog which explains why using InputStream is better than using File in interface
http://java.dzone.com/articles/using-files-your-interfaces-0
> So I suggest to add the following 4 methods in PigServer:
> {code}
> public void registerScript(InputStream in) throws IOException
> public void registerScript(InputStream in, Map<String,String> params) throws IOException
> public void registerScript(InputStream in, List<String> paramsFiles) throws IOException
> public void registerScript(InputStream in, Map<String,String> params,List<String>
paramsFiles) throws IOException 
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message