You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Aniket Mokashi (Created) (JIRA)" <ji...@apache.org> on 2012/01/03 02:08:20 UTC

[jira] [Created] (PIG-2456) Pig should have a pigrc to specify default script cache

Pig should have a pigrc to specify default script cache
-------------------------------------------------------

                 Key: PIG-2456
                 URL: https://issues.apache.org/jira/browse/PIG-2456
             Project: Pig
          Issue Type: New Feature
            Reporter: Aniket Mokashi


There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192914#comment-13192914 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Harsh,

Pig loads properties from $HOME/.pigrc by default. Additional jars can be registered and UDFs can be qualified from here.
Additionally, pig.properties and pig-default.properties are loaded if present in Pig's classpath. 

Are you looking for any other functionality?
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192918#comment-13192918 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

How about, a = load '1.txt' using SomeLoader(); and a is available every time I run grunt?
Btw, pigrc looks interesting! Can you point me to a jira so that I can find its features? 
Thanks,
Aniket
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Prashant Kommireddi updated PIG-2456:
-------------------------------------

    Assignee: Prashant Kommireddi
    
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Daniel Dai updated PIG-2456:
----------------------------

    Release Note: 
User can specify default Pig statements in ~/.pigbootup. Default statements will prepend to every Pig script and Grunt session. 

The default Pig statements filename is configurable via key "pig.load.default.statements"
    
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192931#comment-13192931 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Btw, did you check out MACROS (v0.9). Daniel has a nice post describing the same http://hortonworks.com/new-apache-pig-features-part-1-macro/
It pretty much does what you are looking for. "pigrc" is a configuration file, and I would be inclined to keeping programmatic parts outside of config files.

                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192916#comment-13192916 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

How about, a = load '1.txt' using SomeLoader(); and a is available every time I run grunt?
Btw, pigrc looks interesting! Can you point me to a jira so that I can find its features? 
Thanks,
Aniket
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Prashant Kommireddi updated PIG-2456:
-------------------------------------

    Patch Info: Patch Available
    
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192919#comment-13192919 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

How about, a = load '1.txt' using SomeLoader(); and a is available every time I run grunt?
Btw, pigrc looks interesting! Can you point me to a jira so that I can find its features? 
Thanks,
Aniket
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Joey Echeverria (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13193201#comment-13193201 ] 

Joey Echeverria commented on PIG-2456:
--------------------------------------

The idea is to add a new file that contains pig statements that are always executed. This is more akin to the .hiverc in Hive (https://issues.apache.org/jira/browse/HIVE-1414) than the pig.properties or .pigrc files that already exists. My use case would be to pre-define a bunch of UDFs:

REGISTER /usr/lib/pig/contrib/piggybank/java/piggybank.jar;
DEFINE SequenceFileLoader org.apache.pig.piggybank.storage.SequenceFileLoader();
...

I could also see it being useful to put in common LOAD statements so that you can just start working with the data from grunt.

I tried setting the file variable in .pigrc and pig.properties, but it didn't seem to cause the file to be loaded.

This is somewhat related to macros where I want a default file that is always imported.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196682#comment-13196682 ] 

Daniel Dai commented on PIG-2456:
---------------------------------

Yes, Utils should be better.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200639#comment-13200639 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

How about making udf match case-insensitive? Wouldnt that be a better approach? We already have definedFunctions map, we just have to make it case-insensitive. Not sure if that will break something else. Comments?
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196601#comment-13196601 ] 

Daniel Dai commented on PIG-2456:
---------------------------------

Looks good. I tried dump/store/explain/describe/illustrate, all works fine. I have some minor suggestions:
1. It's better to make pigunit.pig takes .pigbootup as well. pigunit is for user to write their Pig unit test. If user always use .pigbootup, it makes sense he can use that in unit test as well
2. It also better to make the filename .pigbootup configurable, it would benefit for user to write unit test using approach #1
3. Adding a test case. With #2, this should be possible
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13190380#comment-13190380 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Aniket, can you provide an example of this Use Case.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197326#comment-13197326 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Also, user can now specify the bootup file path through configuration property "pig.load.default.statements". If this property is not found, default location $HOME/.pigbootup will be loaded if present.

{code}
   public static InputStream getCompositeStream(InputStream in, Properties properties) {
	   //Load default ~/.pigbootup if not specified by user
    	final String bootupFile = properties.getProperty("pig.load.default.statements", System.getProperty("user.home") + "/.pigbootup");
    	try {
    	final InputStream inputSteam = new FileInputStream(new File(bootupFile));
    	return new SequenceInputStream(inputSteam, in);
    	} catch(FileNotFoundException fe) {
    		log.info("Default bootup file " +bootupFile+ " not found");
    		return in;
    	}
    }
{code}
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13194400#comment-13194400 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Makes sense. This is what I think we could do to support this

1. Create a static method in Main that takes in 1 argument, InputStream and returns a SequenceInputStream which is a composite stream comprised of default file, say ".pigbootup" and the InputStream
2. All individual components within Main call this function to get a handle on the composite stream by passing it the InputStream it uses (Console, FileInput)
3. This composite stream is then passed to Grunt.

Another approach would be to add a new constructor to class Grunt, Grunt(InputStream in, PigContext pig). This constructor will create a composite stream (.pigbootup + console/fileinput), then create a BufferedReader on the composite stream and invoke Grunt(BufferedReader in, PigContext pig)

Not sure which one of these approach' would be better. 

Any suggestions or other ideas?

                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192917#comment-13192917 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

How about, a = load '1.txt' using SomeLoader(); and a is available every time I run grunt?
Btw, pigrc looks interesting! Can you point me to a jira so that I can find its features? 
Thanks,
Aniket
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192920#comment-13192920 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

Apologies, I should upgrade my browser really soon. Sorry for that..
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196612#comment-13196612 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Thanks Daniel.

1. Can you point me to the code/Class' I need to take a look at for enabling this?
2. Makes sense. So have a property "pig.load.default.statements" that can be specified by user? Is .pigbootup required to be loaded from user's home directory (like .pigrc) in case "pig.load.default.statements" is not specified?
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Daniel Dai resolved PIG-2456.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 0.11
     Hadoop Flags: Reviewed

Unit test pass. test-patch:
     [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 4 new or modified tests.
     [exec] 
     [exec]     -1 javadoc.  The javadoc tool appears to have generated 1 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 does not introduce any new Findbugs warnings.
     [exec] 
     [exec]     -1 release audit.  The applied patch generated 527 release audit warnings (more than the trunk's current 523 warnings).

javadoc warning doesn't seems related. No new file added, ignore release audit warning.

Patch committed to trunk.

Thanks Prashant!
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Prashant Kommireddi updated PIG-2456:
-------------------------------------

    Attachment: PIG-2456_2.patch

I have modified org.apache.pig.pigunit.pig.PigServer and TestPigTest to add this functionality to PigUnit. New test added "testDefaultBootup()" to TestPigTest.java

Also, moved "getCompositeStream(InputStream in, Properties properties)" to Utils.java to be used across.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Work started] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Work on PIG-2456 started by Prashant Kommireddi.

> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200987#comment-13200987 ] 

Daniel Dai commented on PIG-2456:
---------------------------------

@Russell
import piggybank can be achieved by -Dpig.additional.jars(http://pig.apache.org/docs/r0.9.2/basic.html#register) and -Dudf.import.list (http://pig.apache.org/docs/r0.9.2/udf.html#eval-functions)
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Russell Jurney (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200649#comment-13200649 ] 

Russell Jurney commented on PIG-2456:
-------------------------------------

Making UDFs not case sensitive makes sense to me, but is a bigger (potentially) breaking change than lowercasing LOWER/UPPER.

I say do it.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13197633#comment-13197633 ] 

Daniel Dai commented on PIG-2456:
---------------------------------

Looks good to me. Will commit if tests pass.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192825#comment-13192825 ] 

Harsh J commented on PIG-2456:
------------------------------

Though you can use a pig.properties file (passable as {{pig -P file}}), which has a "file=" property that can do the same thing.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196631#comment-13196631 ] 

Daniel Dai commented on PIG-2456:
---------------------------------

bq. 1. Can you point me to the code/Class' I need to take a look at for enabling this?
Check org.apache.pig.pigunit.pig.PigServer

bq. 2. Makes sense. So have a property "pig.load.default.statements" that can be specified by user? Is .pigbootup required to be loaded from user's home directory (like .pigrc) in case "pig.load.default.statements" is not specified?
The property name is fine. It has default value $HOME/.pigbootup in pig-default.properties.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192922#comment-13192922 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

These property files are key-value pairs, I believe declaring an alias is not supported.

Here are a couple JIRAs around pig configs, https://issues.apache.org/jira/browse/PIG-111 and https://issues.apache.org/jira/browse/PIG-1381
You could also take a look at PropertiesUtil.loadDefaultProperties(Properties)
{code}
public static void loadDefaultProperties(Properties properties) {
        loadPropertiesFromFile(properties,
                System.getProperty("user.home") + "/.pigrc");
        loadPropertiesFromClasspath(properties, DEFAULT_PROPERTIES_FILE);
        loadPropertiesFromClasspath(properties, PROPERTIES_FILE);
        setDefaultsIfUnset(properties);
        
//foo..
{code}
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Russell Jurney (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200634#comment-13200634 ] 

Russell Jurney commented on PIG-2456:
-------------------------------------

What do we think about... default pig .pigbootup configuration should import piggybank, and define all its functions to short, callable names?
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13196665#comment-13196665 ] 

Prashant Kommireddi commented on PIG-2456:
------------------------------------------

Would Utils be a good place to define "getCompositeStream"? It does not seem the best approach to declare a public function in Main and have it called from outside.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Aniket Mokashi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13198485#comment-13198485 ] 

Aniket Mokashi commented on PIG-2456:
-------------------------------------

Awesome! This is useful.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>             Fix For: 0.11
>
>         Attachments: PIG-2456.patch, PIG-2456_2.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2456) Pig should have a pigrc to specify default script cache

Posted by "Harsh J (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13192824#comment-13192824 ] 

Harsh J commented on PIG-2456:
------------------------------

Hive has this, and is very useful to load/add in some user libraries during startup, or to register temp functions/aliases. I agree Pig should have the very same thing.
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2456) Pig should have a pigrc to specify default script cache

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

Prashant Kommireddi updated PIG-2456:
-------------------------------------

    Attachment: PIG-2456.patch

Changes made to Main.java
                
> Pig should have a pigrc to specify default script cache
> -------------------------------------------------------
>
>                 Key: PIG-2456
>                 URL: https://issues.apache.org/jira/browse/PIG-2456
>             Project: Pig
>          Issue Type: New Feature
>            Reporter: Aniket Mokashi
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2456.patch
>
>
> There should be a way to specify default statements in pig. This is helpful when multiple users are using pig in interactive mode.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira