Hi again,

How about defining a table (t1) with ~ as the delimiter and then creating a
view to that table which uses the regexp_replace UDF?

CREATE VIEW v_user_access AS
SELECT regexp_replace(ip, "\"", "") as ip, ...
FROM t1;

Not sure the implications on joining, but basic queries should work ok I
would think.

HTH,
Tim






On Wed, Apr 18, 2012 at 9:20 PM, Gopi Kodumur <gkodu...@yahoo.com> wrote:

> Thanks Tim, Sorry for not explaining the problem clearly...
>
> I have data in this format ,  I wanted to store the data in Ext-Hive table
> without the Double Quote
>
>
> "127.0.0.17"~"444c1c9a-8820-11e1-aaa8-00219b8a879e"~"2012-04-17T00:00:01Z"~"476825ea-8820-11e1-a105-0200ac1d1c3d
>
> "127.0.0.12"~"544c1c9a-8820-11e1-aaa8-00219b8a879e"~"2012-04-17T00:00:01Z"~"476825ea-8820-11e1-a105-0200ac1d1c3d
>
> "127.0.0.13"~"644c1c9a-8820-11e1-aaa8-00219b8a879e"~"2012-04-17T00:00:01Z"~"476825ea-8820-11e1-a105-0200ac1d1c3d
>
>
>   ------------------------------
> *From:* Tim Robertson <timrobertson...@gmail.com>
> *To:* user@hive.apache.org; Gopi Kodumur <gkodu...@yahoo.com>
> *Sent:* Wednesday, April 18, 2012 12:14 PM
> *Subject:* Re: Can we define external table Fields enclosed in "
>
> I believe so.  From the tutorial [1] :
>
>    CREATE EXTERNAL TABLE page_view_stg(viewTime INT, userid BIGINT,
>                     page_url STRING, referrer_url STRING,
>                     ip STRING COMMENT 'IP Address of the User',
>                     country STRING COMMENT 'country of origination')
>     COMMENT 'This is the staging page view table'
>     ROW FORMAT DELIMITED FIELDS TERMINATED BY '44' LINES TERMINATED BY '12'
>
>
> HTH,
> Tim
>
> [1] https://cwiki.apache.org/confluence/display/Hive/Tutorial
>
>
>
> On Tue, Apr 17, 2012 at 11:20 PM, Gopi Kodumur <gkodu...@yahoo.com> wrote:
>
> Is it possible to specify enclosed by character " for fields , while
> defining external table
>
> Thanks
> Gopi
>
>
>
>
>

Reply via email to