[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15344757#comment-15344757 ] Koji Noguchi commented on PIG-2315: --- bq. Committed the changes to trunk (0.17). After this commit, one test started failing. Sorry I've missed it. Created PIG-4933 for tracking. > Make as clause work in generate > --- > > Key: PIG-2315 > URL: https://issues.apache.org/jira/browse/PIG-2315 > Project: Pig > Issue Type: Bug >Reporter: Olga Natkovich >Assignee: Daniel Dai > Fix For: 0.17.0 > > Attachments: PIG-2315-1-rebase.patch, PIG-2315-1.patch, > PIG-2315-1.patch, pig-2315-2-after-rebase.patch, pig-2315-3-merged.patch > > > Currently, the following syntax is supported and ignored causing confusing > with users: > A1 = foreach A1 generate a as a:chararray ; > After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15311296#comment-15311296 ] Daniel Dai commented on PIG-2315: - +1. Also note there is a performance regression in some cases. For example: {code} crawl = load 'webcrawl' as (url, pageid); extracted = foreach crawl generate flatten(REGEX_EXTRACT_ALL(url, '(http|https)://(.*?)/(.*)')) as (protocol:chararray, host:chararray, path:chararray); {code} Here the users just try to give additional information to Pig since REGEX_EXTRACT_ALL didn't declare types inside tuple and not intend to cast. With the change, Pig force a cast and there is no way to avoid that. The performance hit should be small and I believe it worth to clarify the syntax. > Make as clause work in generate > --- > > Key: PIG-2315 > URL: https://issues.apache.org/jira/browse/PIG-2315 > Project: Pig > Issue Type: Bug >Reporter: Olga Natkovich >Assignee: Daniel Dai > Fix For: 0.17.0 > > Attachments: PIG-2315-1-rebase.patch, PIG-2315-1.patch, > PIG-2315-1.patch, pig-2315-2-after-rebase.patch, pig-2315-3-merged.patch > > > Currently, the following syntax is supported and ignored causing confusing > with users: > A1 = foreach A1 generate a as a:chararray ; > After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15289890#comment-15289890 ] Daniel Dai commented on PIG-2315: - I will try this Friday. > Make as clause work in generate > --- > > Key: PIG-2315 > URL: https://issues.apache.org/jira/browse/PIG-2315 > Project: Pig > Issue Type: Bug >Reporter: Olga Natkovich >Assignee: Daniel Dai > Fix For: 0.17.0 > > Attachments: PIG-2315-1-rebase.patch, PIG-2315-1.patch, > PIG-2315-1.patch, pig-2315-2-after-rebase.patch, pig-2315-3-merged.patch > > > Currently, the following syntax is supported and ignored causing confusing > with users: > A1 = foreach A1 generate a as a:chararray ; > After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15289888#comment-15289888 ] Koji Noguchi commented on PIG-2315: --- [~daijy], when you have time, can you take a look at my suggested change to your original patch? > Make as clause work in generate > --- > > Key: PIG-2315 > URL: https://issues.apache.org/jira/browse/PIG-2315 > Project: Pig > Issue Type: Bug >Reporter: Olga Natkovich >Assignee: Daniel Dai > Fix For: 0.17.0 > > Attachments: PIG-2315-1-rebase.patch, PIG-2315-1.patch, > PIG-2315-1.patch, pig-2315-2-after-rebase.patch, pig-2315-3-merged.patch > > > Currently, the following syntax is supported and ignored causing confusing > with users: > A1 = foreach A1 generate a as a:chararray ; > After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15276838#comment-15276838 ] Koji Noguchi commented on PIG-2315: --- bq. It contains ... Forgot to mention, it also contains the suggested change in dropping userdefinedschema types for the original foreach. > Make as clause work in generate > --- > > Key: PIG-2315 > URL: https://issues.apache.org/jira/browse/PIG-2315 > Project: Pig > Issue Type: Bug >Reporter: Olga Natkovich >Assignee: Daniel Dai > Fix For: 0.17.0 > > Attachments: PIG-2315-1-rebase.patch, PIG-2315-1.patch, > PIG-2315-1.patch, pig-2315-2-after-rebase.patch > > > Currently, the following syntax is supported and ignored causing confusing > with users: > A1 = foreach A1 generate a as a:chararray ; > After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14062246#comment-14062246 ] Olga Natkovich commented on PIG-2315: - Are there plans to get this one into Pig 14? Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Fix For: 0.14.0 Attachments: PIG-2315-1.patch, PIG-2315-1.patch Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14062500#comment-14062500 ] Daniel Dai commented on PIG-2315: - Yes, the patch is ready and I need a review. Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Fix For: 0.14.0 Attachments: PIG-2315-1.patch, PIG-2315-1.patch Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (PIG-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13757098#comment-13757098 ] Koji Noguchi commented on PIG-2315: --- because it is not working anyway. There's at least one case it's working for our users. {noformat} a = load 'input.txt' as (nb:bag{}); b = foreach a generate flatten(nb) as (year, name:bytearray); c = filter b by name == 'user1'; dump c; {noformat} Above case works. But without the ':bytearray' in relation b, it fails. {noformat} a = load 'input.txt' as (nb:bag{}); b = foreach a generate flatten(nb) as (year, name); c = filter b by name == 'user1'; dump c; {noformat} Front End: ERROR 1052: Cannot cast bytearray to chararray Please keep the first case valid. (Thanks [~fuding] for this example.) Error message in the second case is misleading that it's actually trying to typecast NULL to chararray. Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Fix For: 0.12 Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13647945#comment-13647945 ] Daniel Dai commented on PIG-2315: - Agree. However, we cannot break backward incompatibility by disallowing () style cast. We definitely don't encourage using different style of cast. We can mark () deprecate though. Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Fix For: 0.12 Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13636869#comment-13636869 ] Ruslan Al-Fakikh commented on PIG-2315: --- As a user I would desire the way as it was suggested here: https://issues.apache.org/jira/browse/PIG-2216 to allow just one syntax for casting (and forbid/deprecate the other). Daniel, don't you think that: {quote} A1 = foreach A1 generate (int)a as a:chararray; = A1 = foreach A1 generate (chararray)((int)a) as a; {quote} will make things more complicated? Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Fix For: 0.12 Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13153048#comment-13153048 ] Prashant Kommireddi commented on PIG-2315: -- Apologies, it should have read {code} vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as (ts:chararray, runTime:double, cpuTime:double); {code} Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13153049#comment-13153049 ] Prashant Kommireddi commented on PIG-2315: -- Return type of UDF LFV is bytearray. The issue here is that when I pass the field ts to a MIN function, or runTime to a SUM (after a group by) the scripts errors out with a ClassCastException (Cannot convert bytearray to String/Double) Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13151442#comment-13151442 ] Prashant Kommireddi commented on PIG-2315: -- How would this work when a Tuple is being mapped using AS {code} vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as (ts, runTime, cpuTime); {code} Here I call a function LFV which returns a Tuple which is being mapped to {ts, runTime, cpuTime}. Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13151627#comment-13151627 ] Gianmarco De Francisci Morales commented on PIG-2315: - I assume that as long as you don't cast it to some types this should have no effect on your code. In your example you are just renaming fields, not casting them. Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Assignee: Gianmarco De Francisci Morales Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13133991#comment-13133991 ] Gianmarco De Francisci Morales commented on PIG-2315: - What is the desired solution? To make the aforementioned syntax work as a cast or to allow only explicit casting? E.g. {code} A1 = foreach A1 generate (chararray) a; {code} Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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-2315) Make as clause work in generate
[ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13134274#comment-13134274 ] Daniel Dai commented on PIG-2315: - I had a discussion with Thejas before, we want to perform the as cast after we evaluate the generated item: A1 = foreach A1 generate (int)a as a:chararray; = A1 = foreach A1 generate (chararray)((int)a) as a; Make as clause work in generate --- Key: PIG-2315 URL: https://issues.apache.org/jira/browse/PIG-2315 Project: Pig Issue Type: Bug Reporter: Olga Natkovich Currently, the following syntax is supported and ignored causing confusing with users: A1 = foreach A1 generate a as a:chararray ; After this statement a just retains its previous type -- 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