[ 
https://issues.apache.org/jira/browse/FLINK-23237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

hehuiyuan updated FLINK-23237:
------------------------------
    Description: 
(1)Add log to print error data that failed to deserialize when set 
`ignore-parse-error` = `true`

(2)Threre is NPE question when use `new String(message) `  if message is null 
,which causes IOException info is not displayed.
{code:java}
public RowData deserialize(@Nullable byte[] message) throws IOException {
    if (message == null) {
        return null;
    }
    try {
        final JsonNode root = objectReader.readValue(message);
        return (RowData) runtimeConverter.convert(root);
    } catch (Throwable t) {
        if (ignoreParseErrors) {
            return null;
        }
        throw new IOException(
                String.format("Failed to deserialize CSV row '%s'.", new 
String(message)), t);
    }
}
{code}

  was:
(1)Add log to print error data that failed to deserialize when set 
`ignore-parse-error` = `true`

(2)Threre is NPE question when use `new String(message) `  if message is null.
{code:java}
public RowData deserialize(@Nullable byte[] message) throws IOException {
    if (message == null) {
        return null;
    }
    try {
        final JsonNode root = objectReader.readValue(message);
        return (RowData) runtimeConverter.convert(root);
    } catch (Throwable t) {
        if (ignoreParseErrors) {
            return null;
        }
        throw new IOException(
                String.format("Failed to deserialize CSV row '%s'.", new 
String(message)), t);
    }
}
{code}


> Add log to print data that failed to deserialize when  
> ignore-parse-error=true and threre is NPE question when use `new 
> String(message) ` if message = null  
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-23237
>                 URL: https://issues.apache.org/jira/browse/FLINK-23237
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: hehuiyuan
>            Priority: Minor
>
> (1)Add log to print error data that failed to deserialize when set 
> `ignore-parse-error` = `true`
> (2)Threre is NPE question when use `new String(message) `  if message is null 
> ,which causes IOException info is not displayed.
> {code:java}
> public RowData deserialize(@Nullable byte[] message) throws IOException {
>     if (message == null) {
>         return null;
>     }
>     try {
>         final JsonNode root = objectReader.readValue(message);
>         return (RowData) runtimeConverter.convert(root);
>     } catch (Throwable t) {
>         if (ignoreParseErrors) {
>             return null;
>         }
>         throw new IOException(
>                 String.format("Failed to deserialize CSV row '%s'.", new 
> String(message)), t);
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to