[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thejas M Nair updated PIG-693: -- Attachment: 693.2.patch Updated patch incorporating changes suggested in code review . OperatorPlan.java - using Integer for size instead of string - removed imports of LogicalOperator and subclasses - moved special handling of LOProject to patchInputReference method in RemoveRedundantOperators.java - removeAndReconnectMultiSucc() takes into account other successors of A. TestEvalPipeline2.java - Using org.apache.pig.test.utils.Idenity instead of IdenityUDF. > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: 1.0.0 >Reporter: Viraj Bhat >Assignee: Thejas M Nair > Attachments: 693.2.patch, 693.patch, 693.utest.patch, one.txt, > REPLACEALL.java, URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thejas M Nair updated PIG-693: -- Patch Info: [Patch Available] > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: 1.0.0 >Reporter: Viraj Bhat >Assignee: Thejas M Nair > Attachments: 693.patch, 693.utest.patch, one.txt, REPLACEALL.java, > URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thejas M Nair updated PIG-693: -- Attachment: 693.utest.patch Unit test for this bug. This patch is in addition to the patch file attached earlier. > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: 1.0.0 >Reporter: Viraj Bhat >Assignee: Thejas M Nair > Attachments: 693.patch, 693.utest.patch, one.txt, REPLACEALL.java, > URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thejas M Nair updated PIG-693: -- Attachment: 693.patch - All subclasses of LogicalOperator(LOP) (except LOConst,LOProject) no longer maintain a local reference of their inputs. getOperand()/getLhs()/getArguments() etc will access the predecessor in the graph each time. This will avoid problems caused by predecessor and input arguments reference going out of sync. - In above classes, the functions for setting the input arguments have been removed. The constructor also no longer takes arguments as input. - LogToPhyTranslationVisitor - Checking if getPredecessor() is null before calling getOperand().getType(). (Fixes a negative test case failure). - TypeCheckingVisitor - Insertion of casts in LOP s uses the OperatorPlan.insertBetween() function. Common logic used to insert cast in LOPs have been moved to new insertCast(..) function. - LOConst does not have above change because its input is contained within the object, not on the graph. LOProject does not change because input need not be predecessor in graph if input is relational operator. > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: 1.0.0 >Reporter: Viraj Bhat >Assignee: Thejas M Nair > Attachments: 693.patch, one.txt, REPLACEALL.java, URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viraj Bhat updated PIG-693: --- Attachment: REPLACEALL.java EVAL UDF > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: types_branch >Reporter: Viraj Bhat > Fix For: types_branch > > Attachments: one.txt, REPLACEALL.java, URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viraj Bhat updated PIG-693: --- Attachment: one.txt Test input file to start execution > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: types_branch >Reporter: Viraj Bhat > Fix For: types_branch > > Attachments: one.txt, REPLACEALL.java, URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-693) Parameter to UDF which is an alias returned in another UDF in nested foreach causes incorrect results
[ https://issues.apache.org/jira/browse/PIG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Viraj Bhat updated PIG-693: --- Attachment: URLDECODE.java Eval UDF > Parameter to UDF which is an alias returned in another UDF in nested foreach > causes incorrect results > - > > Key: PIG-693 > URL: https://issues.apache.org/jira/browse/PIG-693 > Project: Pig > Issue Type: Bug > Components: impl >Affects Versions: types_branch >Reporter: Viraj Bhat > Fix For: types_branch > > Attachments: URLDECODE.java > > > Consider the following Pig Script > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); --use this dummy file > to start execution > B = foreach A { > dec = myudf.URLDECODE('hello'); > str1 = myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' '); -- ERROR > str2 = myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' '); > generate > dec, > str1, > str2; > }; > describe B; > dump B; > {code} > where one.txt is a file which contains number one (1) for starting execution > of the Pig script!! > {code} > describe B; > {code} > returns the following: > B: {urldecode_9: chararray,replaceall_urldecode_10_11: > chararray,replaceall_12: chararray} > {code} > dump B; > {code} > returns > (hello,[\u-\u0020],hello) > The result should be: > There is a workaround for the same, > {code} > register myudf.jar; > A = load 'one.txt' using PigStorage() as ( one: int ); > B = foreach A { > dec = myudf.URLDECODE('hello'); > generate > dec as dec, > myudf.REPLACEALL(dec, '[\\u-\\u0020]', ' ') as str1, > myudf.REPLACEALL('hello', '[\\u-\\u0020]', ' ') as str2; > }; > describe B; > dump B; > {code} > where > {code} > dump B; > {code} > returns (hello,hello,hello) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.