Forbidding Location Specification When Hive Internal Tables Are Created
Scenario
This function is available in Hive and Spark2x for MRS 3.x or later, or Hive and Spark for versions earlier than MRS 3.x.
After this function is enabled, the location keyword cannot be specified when a Hive internal table is created. Specifically, after a table is created, the table path following the location keyword is created in the default \warehouse directory and cannot be specified to another directory. If the location is specified when the internal table is created, 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
- The Hive service configuration page is displayed.
- For versions earlier than MRS 3.x, click the cluster name. On the cluster details page that is displayed, choose Components > Hive > Service Configuration, and select All from the Basic drop-down list.
If the Components tab is unavailable, complete IAM user synchronization first. (On the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users.)
- For MRS 3.x or later, log in to FusionInsight Manager. For details, see Accessing FusionInsight Manager (MRS 3.x or Later). And choose Cluster > Name of the desired cluster > Services > Hive > Configurations > All Configurations.
- For versions earlier than MRS 3.x, click the cluster name. On the cluster details page that is displayed, choose Components > Hive > Service Configuration, and select All from the Basic drop-down list.
- 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. Restart all Hive instances after the modification.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot