How to Populate the Hue Database

Not every action in the Hue UI touches the Hue database (embedded or custom). This page explains how to populate the database with user account information, Hive queries, and Oozie workflows. This is useful when testing the migration of a database.

  1. Add New User
    1. Log on to Hue as the administrator.
    2. Click the Administration drop-down menu and select Manage Users.
    3. In the Hue Users page, click Add user and specify the following:
      • Type the Username.
      • Type the user's password in the New Password text box.
      • Re-type the user's password.
      • Select the Create home directory check box if you want a home directory created for the user.
      • Click Next.
      • Specify the user's First name, Last name, Email address, and the Groups that the user is a member of.
      • Click Next.
      • Specify whether the user is Active and if you want to grant the user Superuser status.
      • Click Add user.
    4. Log out as the administrator and log in as the new user you just created.
  2. Save Hive Query
    1. In the top right corner of the page, select <user_name> > Hue Administration > Step 2: Examples:



    2. Click download Hue Download icon BlackHive to install sample databases.
    3. In the left panel, click the default database and the customers sample table.
    4. Click Query > Editor > Hive to load the Hive SQL editor.
    5. Drag the customers table onto the Hive editor and select SELECT FROM ... to automatically generate a SELECT query in the editor.
    6. Run the query by placing your cursor in the editor and pressing CTRL + Enter, or by clicking the Run icon Hue Run icon.
    7. Save the query as customers.sql by clicking the Save icon Hue Save icon.
    8. View the query on the Saved Queries tab in the Hive editor:



  3. Save Oozie Workflow
    1. Go to Oozie by selecting, Query > Scheduler > Workflow.
    2. Click the Edit icon in the upper right corner of the Oozie Editor page:



    3. Click My Workflow to rename it and click the check mark Hue Workflow Save icon to save it. In this example, we name it Customers WorkflowYou can add a description in the same way if you want to.
    4. Drag the action icon for a saved Hive query to the field Drop your action here.
    5. Select a saved query from the drop-down list and click Add. In this example, we choose customers.sql.
    6. Save the workflow by clicking the Save icon Hue Save icon at the top of the page.
    7. Submit the workflow by clicking the Run icon Hue Submit Job icon and then clicking Submit. You should see the workflow progress bar change to green, which indicates the workflow ran successfully.
    8. View the saved workflow by clicking the Workflows tab at the top of the page.