Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Hive/ Enterprise-Class Enhancements of Hive/ Forbidding Location Specification When Hive Internal Tables Are Created
Updated on 2024-10-25 GMT+08:00

Forbidding Location Specification When Hive Internal Tables Are Created

The hive.internaltable.notallowlocation parameter can be used to prevent Location from being specified during Hive internal table creation. That is, after the table is created successfully, the location path of the table is created in the current default warehouse directory and cannot be specified in other directories. If Location is specified when creating an internal table, the creation fails.

After this function is enabled, the location keyword cannot be specified during the creation of a Hive internal table. The table creation statement is restricted. If a table that has been created in the database is not stored in the default directory /warehouse, the location keyword can still be specified when the database creation, table script migration, or metadata recreation operation is performed by disabling this function temporarily.

Procedure

  1. Log in to FusionInsight Manager. Click Cluster > Services > Hive, click Configurations > All Configurations.
  2. Choose HiveServer(Role) > Customization, add a customized parameter to the hive-site.xml parameter file, set Name to hive.internaltable.notallowlocation, and set Value to true.
  3. Click Save to save the configuration. Click Instance, select all Hive instances, choose More > Restart Instance, enter the password of the current user, and click OK to restart all Hive instances.
  4. Determine whether to enable this function on the Spark/Spark2x client.

    • If yes, download and install the Spark/Spark2x client again.
    • If no, no further action is required.