Amazon EMR enables you to run Hive scripts or queries in two modes:
When you launch a long-running cluster using the console or the AWS CLI, you can
ssh into the master node as the Hadoop user and use the Hive
Command Line Interface to develop and run your Hive scripts interactively. Using Hive
interactively enables you to revise the Hive script more easily than batch mode. After you
successfully revise the Hive script in interactive mode, you can upload the script to Amazon S3
and use batch mode to run the script in production.
To use Hive interactively in the Amazon EMR CLI, use the
parameter when you launch the cluster.
In batch mode, you upload your Hive script to Amazon S3, and then submit the work to the cluster as a step. Hive steps can be submitted to a long-running cluster or a transient cluster. For more information on submitting work to a cluster, see Submit Work to a Cluster. An example of launching a long-running cluster and submitting a Hive step can be found here: Launch a Cluster and Submit Hive Work.
To launch a cluster in interactive mode using the Amazon EMR CLI
The Amazon EMR CLI is no longer under feature development. Customers are encouraged to use the Amazon EMR commands in the AWS CLI instead.
In the directory where you installed the Amazon EMR CLI, type the following command line. For more information, see the Command Line Interface Reference for Amazon EMR.
Linux, UNIX, and Mac OS X users:
./elastic-mapreduce --create --alive --name
"Hive cluster"\ --num-instances
ruby elastic-mapreduce --create --alive --name
--hive-interactive parameter is only required by the Amazon EMR CLI. You do not
need to use this parameter when launching a cluster using the AWS CLI.