Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Load Timestamp data type fom local file


Copy link to this message
-
Re: Load Timestamp data type fom local file
Sorry but I could not understand the issues you are facing.

When you loaded data, did select col from table for the timestamp column,
what error did you get? what data did you get?
this is the default datetime format "yyyy-MM-dd hh:mm:ss.ffff"

Looking at your sample data seems to match the format. Can you show us some
error or what you expect to see as the query output?
On Mon, Sep 30, 2013 at 3:36 PM, Claudio Reggiani <[EMAIL PROTECTED]> wrote:

> Hello,
>
> For unit testing, I would like to load from a local file data that has
> several columns, one is also Timestamp. The command I use is "LOAD DATA
> LOCAL INPATH... ".
>
> Unfortunately that column does not allow me to load all the dataset. I
> have no error in the log of my local apache hive server, everything looks
> ok. By the way, officially the data type Timestamp is available.
>
> For completeness, I'm using hive version: 0.10.0 and I report both the
> script which format the database and the dataset:
>
> ---------------------
> hive> DROP TABLE momis_test_a_3
> hive> CREATE TABLE momis_test_a_3 (col1 STRING, col2 DOUBLE, col3 FLOAT,
> col4 TIMESTAMP, col5 BOOLEAN) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
> STORED AS TEXTFILE
> hive> LOAD DATA LOCAL INPATH
> '/home/nophiq/Programmi/Eclipse-Indigo-Momis/workspace/datariver/datariver-querymanager/test/sources/hive/dataset3'
> OVERWRITE INTO TABLE momis_test_a_3
>
> ---------------------
> testo1,100.00,201.00,2013-01-­01 04:00:00.123,true
> testo2,300.00,401.00,2013-01-02 04:00:00.123,false
> testo3,500.00,601.00,2013-01-03 04:00:00.123,false
>
>
> Finally, here it is the log from the local server:
>
> Copying data from
> file:/home/nophiq/Programmi/Eclipse-Indigo-Momis/workspace/datariver/datariver-querymanager/test/sources/hive/dataset3
> Copying file:
> file:/home/nophiq/Programmi/Eclipse-Indigo-Momis/workspace/datariver/datariver-querymanager/test/sources/hive/dataset3
> Loading data to table default.momis_test_a_3
> Deleted file:/home/nophiq/Programmi/hive-0.10.0/warehouse/momis_test_a_3
> Table default.momis_test_a_3 stats: [num_partitions: 0, num_files: 1,
> num_rows: 0, total_size: 182, raw_data_size: 0]
> OK
> OK
>
>
> How can I load timestamp data type from a local file? I don't want to
> create an external table.
> Any suggestion?
>
> Thanks
> Claudio Reggiani
>

--
Nitin Pawar
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB