An Error Is Reported When Hive Executes the insert into Statement
Symptom
When a user uses MRS Hive to execute a SQL statement, the following error message is displayed.
Cause Analysis
- The HiveServer log shows the following message at the time when the error is reported.
Figure 2 HiveServer log
- No important information is found in that log, but the metadata field is found in the stack. Therefore, the error may be related to MetaStore.
Figure 3 Metadata in the stack
- The MetaStore log shows the following error information.
Figure 4 MetaStore log
The error context indicates that an error occurs during SQL statement execution, and the following information is displayed in the error message:
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(4000)
The SQL statement fails because the length of all columns exceeds 4000 bytes. The restriction needs to be modified.
Procedure
- Log in to any master node in the cluster as user root and run the su - omm command to switch to user omm.
- Run the following command to log in to the database. There can be security risks if a command contains the authentication password. You are advised to disable the command recording function (history) before running the command.
gsql -p 20051 -d hivemeta -U username -W password
- Run the following command to modify the restriction:
alter table PARTITION_PARAMS alter column PARAM_VALUE type varchar(6000);
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