You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Russell Jurney (JIRA)" <ji...@apache.org> on 2012/10/09 06:34:03 UTC
[jira] [Created] (PIG-2962) Make importing UDFs one line via macros
Russell Jurney created PIG-2962:
-----------------------------------
Summary: Make importing UDFs one line via macros
Key: PIG-2962
URL: https://issues.apache.org/jira/browse/PIG-2962
Project: Pig
Issue Type: Improvement
Affects Versions: 0.11
Reporter: Russell Jurney
Assignee: Daniel Dai
Priority: Minor
Example. This is how you use the AvroStorage UDF in Piggybank:
register /me/pig/contrib/piggybank/java/piggybank.jar
register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar
register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar
define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage();
emails = load '/enron/emails.avro' using AvroStorage();
That is 5 lines. This should be 2 lines:
import 'avro.macro'
emails = load '/enron/emails.avro' using AvroStorage();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIG-2962) Make importing UDFs one line via
macros
Posted by "Jonathan Coveney (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472182#comment-13472182 ]
Jonathan Coveney commented on PIG-2962:
---------------------------------------
Err, I meant "can't you currently register" and now that I think of it I don't think you can either. Doesn't pig have an "include" that just straight up includes the file?
> Make importing UDFs one line via macros
> ---------------------------------------
>
> Key: PIG-2962
> URL: https://issues.apache.org/jira/browse/PIG-2962
> Project: Pig
> Issue Type: Improvement
> Affects Versions: 0.11
> Reporter: Russell Jurney
> Assignee: Daniel Dai
> Priority: Minor
>
> Example. This is how you use the AvroStorage UDF in Piggybank:
> register /me/pig/contrib/piggybank/java/piggybank.jar
> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar
> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar
> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage();
> emails = load '/enron/emails.avro' using AvroStorage();
> That is 5 lines. This should be 2 lines:
> import 'avro.macro'
> emails = load '/enron/emails.avro' using AvroStorage();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIG-2962) Make importing UDFs one line via
macros
Posted by "Jonathan Coveney (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472179#comment-13472179 ]
Jonathan Coveney commented on PIG-2962:
---------------------------------------
Can't you currently define in macros?
Also, as far as define, define doesn't work in macros, and while I agree that it should, there are namespace issues. You yourself wanted namespace security in macros, so I don't know that something defined in a macro should automatically be made global.
> Make importing UDFs one line via macros
> ---------------------------------------
>
> Key: PIG-2962
> URL: https://issues.apache.org/jira/browse/PIG-2962
> Project: Pig
> Issue Type: Improvement
> Affects Versions: 0.11
> Reporter: Russell Jurney
> Assignee: Daniel Dai
> Priority: Minor
>
> Example. This is how you use the AvroStorage UDF in Piggybank:
> register /me/pig/contrib/piggybank/java/piggybank.jar
> register /me/pig/build/ivy/lib/Pig/avro-1.5.3.jar
> register /me/pig/build/ivy/lib/Pig/json-simple-1.1.jar
> define AvroStorage org.apache.pig.piggybank.storage.avro.AvroStorage();
> emails = load '/enron/emails.avro' using AvroStorage();
> That is 5 lines. This should be 2 lines:
> import 'avro.macro'
> emails = load '/enron/emails.avro' using AvroStorage();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira