Community Articles

Find and share helpful community-sourced technical articles.
Labels (2)


Ambari 2.4 introduces the Hue-to-Views Migration tool, which is specifically designed to migrate existing Hue artifacts to an Ambari View.

Currently in Hue the hive queries are saved in ‘Saved Queries’ in Hue UI. These queries can be invoked by the user by going to Saved Queries in Hue UI. HUETOAMBARI_MIGRATION would help in migrating these saved Hive artifacts from Hue to Ambari Hive View. Once the migration is done, the Saved Queries can be viewed from Ambari Hive View.

Currently HUETOAMBARI_MIGRATION would help in migrating the following artifacts from Hue to Ambari Views.

  1. Hive - Saved Queries, Query History
  2. Pig - Saved Scripts, Pig Jobs

The view would use JDBC to connect to Hue database to obtain the artifacts. Once obtained, these would be stored in the Ambari View Server database.

Today, the view migrates the scripts one user at a time. The user to be migrated would be specified during the migration.

Note:- This view does not validate scripts. Non-working Hue scripts will not work in Ambari Views.


  • Ambari Server serving the HUETOAMBARI_MIGRATION view should have connectivity to Hue server
  • Only users with 'Cluster Admin' privilege can do the migration
  • Ambari and Hue JDBC connection details are required while configuring the view
  • The user whose artifacts are being migrated should also exist in Ambari with correct permissions to the respective View (Hive / Pig)
  • Hive and Pig view should be pre-configured and in a workings state

Following article describes how to use HUETOAMBARI_MIGRATION view.

Migrating Hue Artifacts to an Ambari View

  1. View Creation: -

1.1 Create an Instance by going admin > manage ambari > views


1.2 Give a suitable Name


1.3 Enter view Parameters


To show how to fill up the view-parameters we have assumed the following and we will use this while writing the examples in the table

1.Hue Server url :-

2.Hue NameNode

3.NameNode port:- 50070

4.Hue Database Name(mysql):- Huedb

5.Hue Database username(mysql):- hue

6.Hue Database Password(mysql):- hue


8.Ambari Database Name(postgresql):- ambari

9.Ambari Database username(postgresql):- ambari

10.Ambari Database Password(postgresql):- bigdata

The table below describes each of the parameters

Hue Http URLHttps url where Hue server is located<hue http url>
Hue Server hostnameHostname of Hue Server<hue hostname>
Ambari http URLHttp url where Ambari Server <ambari http url>
Ambari Server hostnameHostname of Ambari server<ambari hostname>
Webhdfs URI(Hue)Namenode URI of Huewebhdfs://<hostname>:50070webhdfs://
Webhdfs URI(Ambari)NameNode URI of Ambariwebhdfs://<hostname>:50070webhdfs://
Hue Database DriverJDBC Driver to access Hue DB <db driver>com.mysql.jdbc.Driver
Hue JDBC URLJDBC Url to access Hue DBjdbc:<dbtype>://<hostname>/<db name>jdbc:mysql://
Hue Database UsernameHue Database Username<db username>hue
Hue Database PasswordHue Database Password<db password>hue
Ambari Database DriverJDBC Driver to access Ambari DB<db driver>org.postgresql.Driver
Ambari JDBC URLJDBC Url to access Ambari DBjdbc:<dbtype>://<hostname>/<db name>jdbc:postgresql://
Ambari Database UsernameAmbari Database Username<db username>ambari
Ambari Database PasswordAmbari Database Password<db password>bigdata
Kerberos enabled on Ambari cluster?(y/n)(y/n) for Kerberos <y/n>n
principal name (if kerberos is enabled)If Kerberos enable, Principal Name must be given or else it should be left blank<principal username>ambari-cl1

**For HA Setups: The Hue-to-Views Migration View does not support HA. You must provide the current active namenode for the target cluster regarding the Webhdfs URI for Ambari.

After submitting all the view parameters. click on save. wait for the instance to successfully created.

once the instance is successfully created . click on "Go to instance"


2.Work flow of the view

2.1 Configuration check

If entered values in view parameters are correct then configuration check will succeed and home page of the view will open, incase of any wrong entries in view parameters configuration check will fail and proper stack trace will be shown


In case of any wrong entries in view parameter


2.2 Hive Migration

Click on Hive → HiveHistory Query to transfer executed queries.

Click on Hive → HiveSaved Query to transfer saved queries.


fill up the details

1. User Name (Hue User Name)

1.1 In Ambari also the user should exist in the same name. In this case "hue".

1.2 Make sure that the user in Ambari has the proper access rights to hive and pig views.


Here ,the user "hue" exist in Ambari and has the right to access "HiveView123","hive_1" and "pig_view".

2. Instance Name (Hive View Instance where the queries need to be transferred)

**Make sure the user has permission to access the view instance.In this case target instance is "hive_1" to which user hue has proper access rights.

3. Start Date (Date from which queries need to be transferred - excluding)

4. End Date (Date to which queries need to be transferred - excluding)


Click ‘Submit’. The transfer takes places and the below report is generated


2.3 Pig Migration

Click on PigSaved Script to transfer saved pig jobs

Click on PigJob to transfer executed pig jobs


fill up the details

1. User Name (Hue User Name) ** The queries will be migrating to the same username in Ambari view (make sure that the user exist in Ambari and has the proper right to access Pig views )

2. Instance Name (Pig View where the queries need to be transferred)

3. Start Date (Date from which queries need to be transferred - excluding)

4. End Date (Date to which queries need to be transferred - excluding)


Click ‘Submit’. The transfer takes places and the below report is generated


The migration reports shows the Total number of query selected according your your search criteria(start date, end date ),Number of query actually transferred,Total time taken.

You can verify the migration by login into the hive view or pig view.

Happy migration...

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.
Version history
Last update:
‎08-17-2019 10:32 AM
Updated by:
Top Kudoed Authors