Help Center/ MapReduce Service/ User Guide (ME-Abu Dhabi Region)/ Troubleshooting/ Using Hive/ An Error Occurs When the INSERT INTO Statement Is Executed on Hive But the Error Message Is Unclear
Updated on 2022-12-08 GMT+08:00

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.

Figure 1 Error reported when MRS Hive executes a SQL statement

Cause Analysis

  1. The HiveServer log shows the following message at the time when the error is reported.
    Figure 2 HiveServer log
  2. 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
  3. 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

  1. Log in to any master node in the cluster as user root and run the su - omm command to switch to user omm.
  2. Run the following command to log in to GaussDB:

    gsql -p 20051 -d hivemeta -U username -W password

  3. Run the following command to modify the restriction:

    alter table PARTITION_PARAMS alter column PARAM_VALUE type varchar(6000);