Exporting query results to Amazon S3
Use Hue to export query results to Amazon S3 as a custom file, a MapReduce file, or as a table.
-
Run and Export Results in Hive
- Run the query by clicking Execute .
- Click Get Results .
- Select Export to open the Save query result dialog.
-
Save Results as Custom File
- Select In store (max 10000000 cells) and open the Path to CSV file dialog.
- Navigate into the bucket, s3a://quakes.
- Create folder named, "output."
- Navigate into the output directory and click Select this folder.
- Append a file name to the path, such as quakes.cvs.
- Click Save. The results are saved as
s3a://quakes/output/quakes.csv
.
-
Save Results as MapReduce files
- Select In store (large result) and open the Path to empty directory dialog.
- Navigate into the bucket, s3a://quakes.
- If you have not done so, create a folder named, "output."
- Navigate into the output directory and click Select this folder.
- Click Save. A MapReduce job is run and
results are stored in
s3a://quakes/output/
.
-
Save Results as Table
- Run a query for "moment" earthquakes and
export:
SELECT time, latitude, longitude, mag FROM `default`.`earthquakes` WHERE magtype IN ('mw','mwb','mwc','mwr','mww');
- Select A new table and input
<database>.<new table name>
. - Click Save.
- Click Browse Data
to view the new table.
- Run a query for "moment" earthquakes and
export: