Define Hive Views

Use the Hive View Editor to define a view in Hive physical model.

To define a Hive view

  1. In the Model Explorer, right-click Views and click New.

    An instance of View is created.

  2. Right-click the instance and click Properties. Alternatively, you can also click Views on the Model menu.

    The Hive View Editor opens.

  3. In the navigation grid, select the user-defined type that you want to define and work with the following options:

    Note: Click New New icon in property editors to create a new object on the toolbar to create a view. Use the Enter filter text box to filter a very large list of views to quickly locate the one that you want to define.

    Name

    Specifies the name of the user-defined type. Change the name of the user-defined type in this field.

    Database

    Specifies the database to which the view belongs. Select a database from the drop-down list or click New New icon in property editors to create a new object to create one.

    Use Replace Syntax

    Indicates that if a view of the same name already exists, it should be replaced. The new query must generate the same columns that were generated by the existing view query. However, it may add additional columns to the end of the list.

    Generate

    Generates SQL during forward engineering. Clear the check box if you do not want to generate SQL.

  4. On the General tab, work with the following options:
    Table Properties

    Lets you specify additional table properties.

    View Partition

    Lets you select columns for a partition.

    Note: At least one non-partition column must exist. Also, the last or right-most column in the view must be included in the partition.

    Partition Specification

    Lets you define a partition specification based on the columns selected under View Partition.

    Note: A partition specification must contain all the partition columns. Also, to be able to generate a partition specification, ensure that the Partition check box is selected under Forward Engineering Schema Generation Wizard > Option Selection > View >�Create.

    Additional Note:

    The order of partition columns in the forward engineering script must match the order of columns in the view.

  5. Work with the other tabs in the editor to access additional design features, for example:
    • Specify the tables or views to define the view column in the Select tab.
    • Select the tables and views that you want to participate in the view using the From tab.
    • Change the type of the view to user-defined and specify the SQL code using the User Defined SQL tab.
    • View the SQL code used during Forward Engineering using the SQL tab.
    • Enter text to define a WHERE clause in the Where tab.
    • Specify the order of DDL generation in the Object Creation Order tab.
    • Define function permissions using the Permission tab.
    • Work with style sheets which are used to format the font and other graphical themes used in the display of the view in the Style tab.
    • Specify the icon style to use for the view in the Icon tab.
  6. (Optional) Click the Comment tab and enter any comments that you want to associate with the object.
  7. (Optional) Click the UDPtab to work with user-defined properties for the object.
  8. (Optional) Click the Notestab to view and edit user notes.
  9. (Optional) Click the Extended Notes tab to view or edit user notes.
  10. Click Close.

    The view is defined and the Hive View Editor closes.

For more information, refer to Hive documentation.