Failed to Save Log Parsing Results Due to Long Query
Problem Description
|
Item |
Information |
|---|---|
|
Source of the Problem |
Online maintenance |
|
Product |
Kunpeng BoostKit |
|
Sub-item |
Big data |
|
Service Scenario |
Debugging and running |
|
Component |
Other |
|
Output Time |
2023-01-29 |
|
Author |
Wu Ruiheng |
|
Team |
Kunpeng BoostKit |
|
Review Result |
Review passed |
|
Review Date |
2024-01-30 |
|
Release Date |
2024-03-30 |
|
Keywords |
Failed to save log parsing results due to long query |
|
Document |
OmniAdvisor Feature Guide |
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.
- Access the database used by OmniAdvisor.
# Connect to the database. mysql -u username -p password # Access the database. use my_database;
- Change the type of the query field in the history_config table to LONGTEXT.
ALTER TABLE history_config MODIFY query LONGTEXT;
- Parse the logs of the task again.