phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: LIKE operator in Phoenix
Date Mon, 09 Jun 2014 17:28:00 GMT
Please file a JIRA here: https://issues.apache.org/jira/browse/PHOENIX
and include the query plus your create table statement.
Thanks,
James

On Mon, Jun 9, 2014 at 1:33 AM, Ramya S <ramyas@suntecgroup.com> wrote:
>
> Tried the same query using  CAST but it shows type mismatch error as  : Type mismatch.
INTEGER and VARCHAR for ASH_ID
>
> Please help to solve...
>
>
>
> Thanks
> Ramya.S
>
>
> ________________________________
>
> From: James Taylor [mailto:jamestaylor@apache.org]
> Sent: Mon 6/9/2014 10:46 AM
> To: user
> Subject: Re: LIKE operator in Phoenix
>
>
>
> You can do the following instead:
>
> select * from account_service_history  where CAST(ash_id AS VARCHAR)
> LIKE  '217%';
>
> If this is a common operation, might be better to use VARCHAR instead
> of INTEGER for your column type.
>
> Thanks,
> James
>
> On Sun, Jun 8, 2014 at 10:08 PM, Ramya S <ramyas@suntecgroup.com> wrote:
>> Hi,
>>
>>
>> Consider the below query as an example, where the ASH_ID column is INTEGER type.
>>
>> select * from account_service_history  where ash_id LIKE  '217%';
>>
>>
>> While firing such a query in phoenix gives a type mismatch error.
>>
>> Does phoenix handles  type cast of Integer/Double to a string  internally?
>>
>>
>>
>> Thanks
>>
>> Ramya.S
>>
>>
>> ________________________________
>>
>> From: James Taylor [mailto:jamestaylor@apache.org]
>> Sent: Mon 6/9/2014 9:48 AM
>> To: user
>> Subject: Re: LIKE operator in Phoenix
>>
>>
>>
>> Can you give an example of what you mean? LIKE is for strings, but you
>> can cast an Integer/Double to a string.
>>
>> Thanks,
>> James
>>
>> On Sun, Jun 8, 2014 at 9:02 PM, Ramya S <ramyas@suntecgroup.com> wrote:
>>>
>>>
>>> Does the LIKE operator in phoenix support  Integer/Double  column values ?
>>>
>>>
>>>
>>> Thanks
>>> Ramya.S
>>>
>>>
>>
>>
>
>

Mime
View raw message