-- creating table in HIVE using HQL

drop table if exists venda;

CREATE TABLE IF NOT EXISTS venda (id_venda  INT,fk_importacao  INT,fk_concessionaria INT,fk_cidade INT ,fk_bairro INT,
fk_modelo INT,chassi STRING,emplacamento string) ROW FORMAT delimited fields terminated by ',' STORED AS TEXTFILE;

--loading data into table (csv file)
load data local inpath '/home/trendwise/hive_data/tables_csv/venda.csv' overwrite into table venda;

--create table with single field for loading text file
create table doc(
text string
) row format delimited fields terminated by '\n' stored as textfile;

-- Loading single file
load data local inpath '/home/trendwise/Documents/sentiment/doc_data/wikipedia' overwrite into table doc;