Connecting to Hive using Beeline

后端 未结 7 1139
傲寒
傲寒 2020-12-29 06:28

I am trying to connect to hive installed in my machine through Beeline client. when I give the \'beeline\' command & connect to Hive, the client is asking for user name

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-29 06:51

    You can use blank username and password as @sravan mentioned. This will execute the query as the user that the hiveserver2 process is running as.

    However, if you have set the hive.server2.enable.doAs property in your hive-site.xml or put it in hiveconf while running hiveserver2 then you can optionally pass a username and password via the prompt. In this case hive will execute the query as the passed username using the given password. The username here is a system username.

    In some scenarios it's required - say you are running the hiveserver2 process as the user 'hive' but you have an external table defined with HDFS path /user/alex/table1, which is owned by the user 'alex' and no other user has read/write access on this location. In this case running the query as 'hive' - by putting empty username and password - will not work since it will not be able to access the directory and throw a permission denied Exception.

提交回复
热议问题