Skip to content

Conversation

@baomingyu
Copy link
Contributor

@baomingyu baomingyu commented Jan 15, 2026

Fixes #12065

Modifications

modifications like this

try {

            return ((BasicFormatInfo<?>) fieldFormatInfo).deserialize(fieldText);
        } catch (Exception e) {
            if (failureHandler != null) {
                failureHandler.onConvertingFieldFailure(fieldName, fieldText, fieldFormatInfo,
                        head, inLongMsgBody, originBody, e);
            } else {
                LOG.warn("Could not properly deserialize the" + "text: {},for field:{}"
                        + ". predefinedFields = {},fields = {}, attr={}, originBody={}",
                        fieldText, fieldName,
                        head == null ? "" : head.getPredefinedFields(),
                        inLongMsgBody == null ? "" : inLongMsgBody.getFields(),
                        head == null ? "" : head.getAttributes(),
                        originBody == null ? (inLongMsgBody == null ? "" : new String(inLongMsgBody.getDataBytes()))
                                : originBody,
                        e);
            }
        }

When defining the failureHandler, the output shall be generated through onConvertingFieldFailure if it is implemented; otherwise, the output shall be written to the log.

@baomingyu baomingyu force-pushed the 202601141107_format_error_info branch 4 times, most recently from 52e1c27 to 93dbfb7 Compare January 15, 2026 02:23
@baomingyu baomingyu force-pushed the 202601141107_format_error_info branch from 93dbfb7 to 8081d8d Compare January 15, 2026 02:32
* The body of the record.
*/
private final byte[] data;
private final byte[] dataBytes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be a compatibility issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InLongMsgBody is used internally when parsing messages, and there are no compatibility issues.

@baomingyu baomingyu merged commit e101491 into apache:master Jan 16, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improve][Sort] Sort Format supports outputting complete row information when errors occur in field parsing.

4 participants