Database Reference
In-Depth Information
$ hadoop fs -mkdir input
$ hadoop fs -put /Users/Test/Data/Source/
Books.csv input
2. Run Hive from command line to create a data structure around the imported
data:
$ hive
hive> CREATE TABLE IF NOT EXISTS
BOOKSDATA
> (ISBN STRING,
> BookTitle STRING,
> BookAuthor STRING,
> YearOfPublication STRING,
> Publisher STRING,
> ImageURLS STRING,
> ImageURLM STRING,
> ImageURLL STRING)
> COMMENT 'BX-Books Table'
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY ';'
> STORED AS TEXTFILE;
OK
Time taken: 0.086 seconds
3. Query data from the structure created above:
hive> LOAD DATA INPATH '/user/Test/data/
source/Books.csv' OVERWRITE INTO TABLE
BOOKSDATA ;
Loading data to table default.booksdata
Deleted hdfs://localhost:9000/user/hive/
warehouse/bxdataset
OK
Time taken: 0.192 seconds
hive> select yearofpublication,
Search WWH ::




Custom Search