Running Hive client tools with embedded servers is a convenient way to test a query or debug a problem. While both Hive CLI and Beeline can embed a Hive server instance, you would start them in embedded mode in slightly different ways.
To start Hive CLI in embedded mode, just launch the client without giving any connection parameters:
To start Beeline in embedded mode, a little more work is required. Basically, a connection URL of jdbc:hive2:// needs to be specified:
> beeline -u jdbc:hive2://
At this point, Beeline enters interactive mode, in which queries and commands against the embedded HiveServer2 instance can be executed.