phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Soldatov <sergeysolda...@gmail.com>
Subject Re: [EXTERNAL] Re: TEXT Data type in Phoenix?
Date Thu, 31 Mar 2016 00:06:37 GMT
Jon,
I believe that it's just only metadata stuff. The VARCHAR
implementation itself doesn't rely on the size.

Thanks,
Sergey

On Wed, Mar 30, 2016 at 4:51 PM, Cox, Jonathan A <jacox@sandia.gov> wrote:
> Sergey,
>
> Thanks for the tip. Is there any real performance reason (memory or speed) to use a pre-defined
length for VARCHAR? Or is it really all the same under the hood?
>
> -Jonathan
>
> -----Original Message-----
> From: sergey.soldatov@gmail.com [mailto:sergey.soldatov@gmail.com] On Behalf Of Sergey
Soldatov
> Sent: Wednesday, March 30, 2016 5:38 PM
> To: user@phoenix.apache.org
> Subject: [EXTERNAL] Re: TEXT Data type in Phoenix?
>
> Jon,
> It seems that documentation is a bit outdated. VARCHAR supports exactly what you want:
> create table x (id bigint primary key, x varchar); upsert into x values (1, "..... (a
lot of text there) " );
> 0: jdbc:phoenix:localhost> select length(x) from x;
> +------------+
> | LENGTH(X)  |
> +------------+
> | 1219       |
> +------------+
> 1 row selected (0.009 seconds)
>
> Thanks,
> Sergey
>
> On Wed, Mar 30, 2016 at 1:57 PM, Cox, Jonathan A <jacox@sandia.gov> wrote:
>> Is it possible to have the equivalent of the SQL data type “TEXT” with
>> Phoenix? The reason being, my data has columns with unspecified text length.
>> If I go with a varchar,  loading the entire CSV file into the database
>> may fail if one entry is too long.
>>
>>
>>
>> Maybe, however, there is really no reason to use TEXT with Phoenix?
>> Perhaps just using VARCHAR with a very long size is equivalent in
>> terms of performance and memory usage (given that Phoenix is HBase under the hood)?
>>
>>
>>
>> Thanks,
>>
>> Jon

Mime
View raw message