Updated on 2022-08-12 GMT+08:00

Why Does the use database Statement Become Invalid When Hive Is Used?

Question

When Hive is used, the use database statement is entered in the text box to switch the database, and other statements are also entered, why does the database fail to be switched?

Answer

Using Hive on Hue is different from using Hive on the Hive client. There is an option to select a database on the Hue interface, and the database where the current SQL is executed is the one that is displayed on the interface. You are advised to use functions on the Hue interface instead of using statements to perform session-level and one-off operations, for example, setting parameters. If you must enter specific statements to perform an operation, ensure that all statements you enter are in one text box.