You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Jeff Zhang (JIRA)" <ji...@apache.org> on 2010/10/11 03:57:54 UTC

[jira] Created: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

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.8.0


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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Olga Natkovich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Natkovich updated PIG-1675:
--------------------------------

    Fix Version/s:     (was: 0.8.0)
                   0.9.0

Since we already branched for 0.8, moving this for discussion to 0.9

> 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_1675.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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922389#action_12922389 ] 

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

Feedback from testpatch.sh

{code}
     [exec] -1 overall.  
     [exec] 
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec] 
     [exec]     +1 tests included.  The patch appears to include 8 new or modified tests.
     [exec] 
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
     [exec] 
     [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
     [exec] 
     [exec]     -1 findbugs.  The patch appears to introduce 1 new Findbugs warnings.
     [exec] 
     [exec]     +1 release audit.  The applied patch does not increase the total number of release audit warnings.
     [exec] 
     [exec] 
     [exec] 
     [exec] 
     [exec] ======================================================================
     [exec] ======================================================================
     [exec]     Finished build.
     [exec] ======================================================================
     [exec] ======================================================================
     [exec] 
     [exec] 
{code}

I'll attach the file from findbugs.  It's complaining about cleanup of resources in your change.

> 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_1675.patch, PIG_1675_2.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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Zhang updated PIG-1675:
----------------------------

    Attachment: PIG_1675_2.patch

Update the patch according Alan's suggestion (catch FileNotFoundException)

> 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_1675.patch, PIG_1675_2.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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922574#action_12922574 ] 

Jeff Zhang commented on PIG-1675:
---------------------------------

Alan, it complains that I may not close the FileInputStream. I modify the code( close the stream in the finally block of method registerScript(InputStream in, Map<String,String> params,List<String> paramsFiles)

BTW, findbugs is really good tool which can help us stick to the best practice. :)



> 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
>
>
> 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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Gates updated PIG-1675:
----------------------------

    Status: Open  (was: Patch Available)

> 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_1675.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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Zhang updated PIG-1675:
----------------------------

    Status: Patch Available  (was: Open)

> 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
>
>
> 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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922319#action_12922319 ] 

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

+1

> 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_1675.patch, PIG_1675_2.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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Zhang updated PIG-1675:
----------------------------

    Status: Patch Available  (was: Open)

> 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.8.0
>
>         Attachments: PIG_1675.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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Zhang updated PIG-1675:
----------------------------

    Attachment: PIG_1675_3.patch

> 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
>
>
> 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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922593#action_12922593 ] 

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

I also ran all the unit tests, and they pass.

> 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
>
>
> 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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Jeff Zhang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Zhang updated PIG-1675:
----------------------------

    Attachment: PIG_1675.patch

> 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.8.0
>
>         Attachments: PIG_1675.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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920656#action_12920656 ] 

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

I think this is a good change.  One concern is that in the current version, when the filename is opened using new FileInputStream(), that call is wrapped in a try/catch that looks for FileNotFound exception.  Your changes remove that.  We still want to catch that and return a good error.  

So in your patch
{code}
 public void registerScript(String fileName, Map<String,String> params,List<String> paramsFiles) throws IOException {
       registerScript(new FileInputStream(fileName), params, paramsFiles);
 }
{code}

should include the try/catch statement with appropriate logging.


> 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_1675.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.


[jira] Updated: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Gates updated PIG-1675:
----------------------------

    Attachment: pig-findbugs-report.html

> 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
>
>
> 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.


[jira] Commented: (PIG-1675) Suggest to allow PigServer can register pig script from InputStream

Posted by "Alan Gates (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-1675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922599#action_12922599 ] 

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

In your change you close the InputStream no matter what.  Perhaps we should only close it if we opened it.  Other than that changes look good.

> 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
>
>
> 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.