Options

how to convert the epoch while loading the data

Hi All, 

 

There is an column timestamp which contains epoch value .

 

i want to convert the value to human readable format while loading using copy command.

 

the problem is that when i tried to use to_timestamp(timestamp::int) it works on select query but the same when used in copy command while loading it throws an error as the column name is also timestamp. 

 

the raw data also contains the header with same as below column names

 

example :

 

copy test.abc_sample_data
(
TIMESTAMP,

EVENTTYPE,

ADSERVER,

AGENCYID,

USERID,

ADVERTISERID,

CAMPAIGNID,

PLACEMENTID,

CREATIVEID,

PARAM1,

PARAM2,

PARAM3,

PARAM4,

PARAM5

)
FROM '/acb/implog.2015-10-26.log'
NULL as '\n'
ENCLOSED BY '"'
no escape
rejected data as table test.abc_sample_data_rejected
skip 1
DELIMITER E'\t'
direct ;

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file