Hi Divya,

are you trying to replace slash in the middle? ltrim will do the
replacement at the begging of the string. If yes, you might new
regexp_replace function.

select '/abc', ltrim('/abc', '/') from (values(1));

-------------------------------------------------------------------------------------
| EXPR$0<VARCHAR(REQUIRED)>               | EXPR$1<VARCHAR(REQUIRED)>
         |
-------------------------------------------------------------------------------------
| /abc                                    | abc
         |
-------------------------------------------------------------------------------------


select 'a/bc', regexp_replace('a/bc', '/', '') from (values(1));

-------------------------------------------------------------------------------------
| EXPR$0<VARCHAR(REQUIRED)>               | EXPR$1<VARCHAR(REQUIRED)>
         |
-------------------------------------------------------------------------------------
| a/bc                                    | abc
         |
-------------------------------------------------------------------------------------

Kind regards,
Arina





On Wed, Sep 19, 2018 at 6:33 AM Divya Gehlot <[email protected]>
wrote:

> Hi ,
> I haven't upgraded to Drill 1.14 yet .
> Here is the query and data
> SELECT `IP_Subnet`,LTRIM(`IP_Subnet`,'/') AS Subnets FROM
> `tmp`.`default`.`./mapping/` ;
>
> The LTRIM not working on special characters :(
>
> IP_Subnet
> Subnets
> 10.128.18.0/23 10.128.18.0/23
> 10.128.20.0/24 10.128.20.0/24
> 10.128.36.0/23 10.128.36.0/23
> 10.128.86.0/23 10.128.86.0/23
> 10.128.18.0/23 10.128.18.0/23
>
>
> Thanks,
> Divya
>
>
> On Wed, 19 Sep 2018 at 03:01, Karthikeyan Manivannan <[email protected]
> >
> wrote:
>
> > Hi Divya,
> >
> > Can you please post your query and and an example of the column data. And
> > have you tried this on Drill 1.14 ?
> >
> > Thanks.
> >
> > Karthik
> >
> > On Mon, Sep 17, 2018 at 2:27 AM Divya Gehlot <[email protected]>
> > wrote:
> >
> > > Hi,
> > > I am using Drill 1.10
> > > My apologies if My query is naive .
> > > One of the table column field has special character like '/'
> > > when I am doing RTRIM on it to just get the data before the '/' , it's
> > not
> > > working :(
> > >
> > > Appreciate if anybody know how it works in Apache Drill !
> > >
> > > Thanks,
> > > Divya
> > >
> >
>

Reply via email to