我要评分
获取效率
正确性
完整性
易理解

Failed to Save Log Parsing Results Due to Long Query

Symptom

During SQL task parsing, the query statement is long and the query field exceeds 64 KB, which exceeds the maximum storage length of the MySQL TEXT type. As a result, after the log parsing module successfully parses the query statement and saves the parsing results to the database, the following error information is displayed:

javax.persistence.PersistenceException: Error[Data truncation: Data too long for column 'query' at row 1]

Key Process and Cause Analysis

None

Conclusion and Solution

Manually change the type of the query field in the history_config table to LONGTEXT. Compared with the TEXT type, the LONGTEXT type can store a maximum of 4 GB text, which meets basic requirements.

  1. Access the database used by OmniAdvisor.
    # Connect to the database.
    mysql -u username -p password
    # Access the database.
    use my_database;
  2. Change the type of the query field in the history_config table to LONGTEXT.
    ALTER TABLE history_config MODIFY query LONGTEXT;
  3. Parse the logs of the task again.