As mentioned here in the quickstart guide [1]: https://hive.apache.org/developement/quickstart/
I believe the host name of the program is hiveserver2 instead of localhost, I have got it up and running in docker.