[ 
https://issues.apache.org/jira/browse/PIG-4383?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Dai resolved PIG-4383.
-----------------------------
    Resolution: Invalid

This statement works:
{code}
C= foreach B generate SUBSTRING( TRIM(pl),idx+1,(int)sz-1) as st;
{code}

Note if the arguments of SUBSTRING is out of boundary, Pig will return a null.

> parametrize SUBSTRING NOT WORKING
> ---------------------------------
>
>                 Key: PIG-4383
>                 URL: https://issues.apache.org/jira/browse/PIG-4383
>             Project: Pig
>          Issue Type: Bug
>          Components: build
>    Affects Versions: 0.12.0
>         Environment: CENTOS
>            Reporter: Ashish Soni
>
> Substring doesnt work when parameterized
> 94km SSE of False Pass, Alaska
> Expected result ( Alaska) 
> B=  foreach A generate mag,TRIM(place) as pl:chararray, 
> LAST_INDEX_OF(TRIM(place),',')as idx:int,SIZE(TRIM(place)) as sz:int ;
> C= foreach B generate mag SUBSTRING( TRIM(pl),idx,sz ) as st:chararray ;
> Thanks,



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to