[ https://issues.apache.org/jira/browse/PIG-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12970090#action_12970090 ]
Julien Le Dem commented on PIG-1479: ------------------------------------ Hi Richard, Thank you for the updated patch. Follow my comments, all related to usability: * Pig script invocation The main invocation mechanism is as follows: {code} results = pig.compile("<Pig Latin>").bind({param:value, ...}).run() {code} I was proposing to also bind variables automatically to local variables in the current scope. {code} results = pig.compile("<Pig Latin>").bindToLocal().run() {code} or more simply {code} results = pig.run("<Pig Latin>") {code} (as implemented in the original submission) I understand that all languages may not allow that, but all scripting languages I can think of allow it. Only compiled languages strip variable names. This could be optional for the implementation. If the bind() step is usefull in some situations and is more generic, it is not the most frequent use case. Implicit binding to local variables is an important feature. As the Pig script is embedded in a particular context, in most use cases the parameters will have the same name than the local variables used to populate them. The goal is to embed Pig, making the integration seemless. Most cases won't need the indirection to have different parameter names from local variables, making it a burden for the developper. * Ability to have the main program and the UDFs in the same script This was the main reason I started this work. The goal was to have everything in one script. The fact that the UDFs are run on the slaves should not force the user to put them in a separate file. The main goal is to have the entire algorithm in the same place without arbitrary separations like this one. When putting in the balance having a main() function vs not being able to have UDFs in the same file I will definitly choose to have a main() function. Just embedding Pig without having UDFs in the same file is not very different from running the Pig command line from a script. > Embed Pig in scripting languages > -------------------------------- > > Key: PIG-1479 > URL: https://issues.apache.org/jira/browse/PIG-1479 > Project: Pig > Issue Type: New Feature > Reporter: Julien Le Dem > Assignee: Richard Ding > Fix For: 0.9.0 > > Attachments: PIG-1479.patch, PIG-1479_2.patch, PIG-1479_3.patch, > PIG-1479_4.patch, pig-greek-test.tar, pig-greek-test.tar, pig-greek.tgz > > > It should be possible to embed Pig calls in a scripting language and let > functions defined in the same script available as UDFs. > This is a spin off of https://issues.apache.org/jira/browse/PIG-928 which > lets users define UDFs in scripting languages. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.