First, you need to give your csv file a header. For example,
col1,col2,col3,...etc.
70268503,"2012-09-28 15:00:59",0,",01","18,01",,1,"
2012-10-01 17:01:11",0,,
Then create the table with,
CREATE TABLE IF NOT EXISTS foo (
col1 INT,
col2 STRING,
col3 INT
...
)
ROW
I have a small table in mysql (Two rows) and I created a Hive version of it
using HQL,
CREATE TABLE IF NOT EXISTS
port_usage (protocolID INT, ports STRING, bytesReceived INT, description
STRING)
STORED BY 'com.foo.MyDatabaseStorageHandler'
TBLPROPERTIES ("mapred.jdbc.driver.class"="com.mysql.j
details are at:
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL.
>
> Hope that helps.
> Szehon
>
>
>
>
> On Mon, Mar 10, 2014 at 12:38 PM, Kim Chew wrote:
>
>> So I have generated my input file in SequenceFile format like this
>>
&
ry specifying row, field delimiter on create table ?
>
> Thanks
> Szehon
>
>
>
> On Fri, Mar 7, 2014 at 5:27 PM, Kim Chew wrote:
>
>> I have an input file in Sequence File format which has the format,
>>
>> which has the type
>>
>> Then I cr
No, I haven't. Let me try putting a delimiter between rows, thanks.
Kim
On Fri, Mar 7, 2014 at 5:53 PM, Szehon Ho wrote:
> Hi, did you try specifying row, field delimiter on create table ?
>
> Thanks
> Szehon
>
>
>
> On Fri, Mar 7, 2014 at 5:27 PM, Kim Chew wro
I have an input file in Sequence File format which has the format,
which has the type
Then I created a table,
CREATE TABLE if not exists TEST (
value string)
STORED AS SEQUENCEFILE;
and then I load the input file to the table. However when I do a query,
select value from TEST;
I fou