This is second post in the Hadoop hands-on series. In last post we have,
Go to Hue > Beeswax (User interface for HiveQL)
Now you should be able to see the query editor. You can enter one query at a time from list of queries below and get the results. Refer the following screenshots
As shown above, enter the query and click on "Execute".
Select all records
Query: Select * from nyse_stocks
Save the results
You can see the option "Save" in screenshot above, which will save the results for corresponding query. We have two options, either we can save it as a new table or a file in HDFS directory as shown below.
Other than this we can get the file using "Download as" option, in comma separated (csv) or excel (xls) file.
Describe the database table
Query: describe nyse_stocks
Get number of records
Query: select count(*) from nyse_stocks
Display records with specific condition
Query: select * from nyse_stocks where stock_symbol="IBM"
- Hadoop instance running
- Data uploaded in HDFS and HCatalog
Go to Hue > Beeswax (User interface for HiveQL)
Now you should be able to see the query editor. You can enter one query at a time from list of queries below and get the results. Refer the following screenshots
As shown above, enter the query and click on "Execute".
Select all records
Query: Select * from nyse_stocks
Save the results
You can see the option "Save" in screenshot above, which will save the results for corresponding query. We have two options, either we can save it as a new table or a file in HDFS directory as shown below.
Other than this we can get the file using "Download as" option, in comma separated (csv) or excel (xls) file.
Describe the database table
Query: describe nyse_stocks
Get number of records
Query: select count(*) from nyse_stocks
Display records with specific condition
Query: select * from nyse_stocks where stock_symbol="IBM"
No comments:
Post a Comment