database - vertica copy unix epoch into TIMESTAMPTZ -
I want to load the data from HDFS, but the time_stamp value in the data is in the Unix Era format and I want to load it. Vertica in TIMESTAMPTZ in vertical form.
In this case, do not know how to use the cast function when flying.
COPY search_mmx2 Source Hdfs (url = 'http: // HELOP-Nominal: 50070 / Webhdfs / v1 / tmp / export / 2014/07/15/00 / SEARCHES / part-m- 0000 * .bz2 ', username =' xyz ') Filter BZip () DELIMITER E' \ t '; Or is there any other / better way to do this?
You will need to clearly define the column list, use a filler and then Get to change the data type on the load:
create table public.test (timestamp TIMESTAMPTZ); Copy public.test (unix_timestamp FILLER VARCHAR (15), from time to time TO_TIMESTAMP (unix_timestamp)) with STDIN; & Gt; & Gt; 1388552400 & gt; & Gt; 13 91230800 & gt; & Gt; \. Choose from * public *; This gives us
datetime ------------------------ 2014-02 - 01 00: 00: 00-05 2014-01-01 00: 00: 00-05
Comments
Post a Comment