An Error Occurs When the INSERT INTO Statement Is Executed on Hive But the Error Message Is Unclear
Issue
An error is reported when a user uses MRS Hive to execute a SQL 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 GaussDB:
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.