1

I want to create a external table in Qubole similar to a table created in Mysql. Query for create table in mysql is:

CREATE TABLE `mytable` (
 `id` varchar(50) NOT NULL,
 `v_count` int(11) DEFAULT NULL,
 `l_visited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 `f_visited` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

can anyone help me to write similar query in hive.

Sadikhasan
  • 18,365
  • 21
  • 80
  • 122
Rahul Kumar
  • 161
  • 1
  • 6
  • 1
    Hey, rather than directly asking for solution, can you please start with some simple query and then ask for help when you are struck? – Gurupad Hegde Dec 09 '15 at 05:28

1 Answers1

1

try this way :

CREATE TABLE page_view(viewTime INT, userid BIGINT,
                page_url STRING, referrer_url STRING,
                ip STRING COMMENT 'IP Address of the User')
COMMENT 'This is the page view table'
PARTITIONED BY(dt STRING, country STRING)
STORED AS SEQUENCEFILE;

Follow this links: link1

link2

Thronk
  • 624
  • 14
  • 37
Amitesh Kumar
  • 3,051
  • 1
  • 26
  • 42