Let us use NYSE data and see how we can create tables in Hive.
- Data Location (Local): /data/nyse-all/nyse-data
- Create a database with the name – YOUR_OS_USER_NAME_nyse
- Table Name: nyse_eod
- File Format: TEXTFILE (default)
- Review the files by running Linux commands before using data sets. Data is compressed and we
- can load the files as is.
- Copy one of the zip files to your home directory and preview the data. There should be 7 fields.
- you need to determine the delimiter.
- Field Names:Åockticker, tradedate, openrice, high price, low price, closeprice, volume
- Determine correct data types based on the values
- Create a Managed table with default Hive Delimiter.
- As delimiters in data and tables are not the same, you need to figure out how to get data into the target table.
Run the following queries to ensure that you will be able to read the data.