hutiefang76 opened a new issue, #12863:
URL: https://github.com/apache/seatunnel/issues/12863

   ### Search before asking
   
   - [x] Searched existing issues and open/closed PRs. The default-value work 
in #11633 changes a different behavior.
   
   ### What happened
   
   With `ignoreParseErrors=true`, malformed Maxwell JSON still throws a 
NullPointerException. The common JSON conversion returns null for a rejected 
record, but the Maxwell deserializer immediately reads `jsonNode.get("type")`.
   
   A direct format-level reproduction on current dev is:
   
   ```java
   MaxWellJsonDeserializationSchema schema =
           MaxWellJsonDeserializationSchema.builder(catalogTable)
                   .setIgnoreParseErrors(true)
                   .build();
   schema.deserialize("{oops".getBytes(StandardCharsets.UTF_8), collector);
   ```
   
   `catalogTable` is an ordinary four-column schema (`id INT`, `name STRING`, 
`description STRING`, `weight DOUBLE`). A valid Maxwell insert works with the 
same schema. The malformed record should be skipped and emit no rows, as the 
sibling Canal, Ogg and Debezium deserializers do when parsing is ignored.
   
   The regression has been reproduced locally. I will add the missing null 
guard and cover ignored malformed input, strict rejection and a valid record in 
the existing Maxwell test suite.
   
   ### SeaTunnel Version
   
   Current dev, e2957d27afa29d4de4324cf642450757d865b902.
   
   ### SeaTunnel Config
   
   Direct format API reproduction with `setIgnoreParseErrors(true)`; no 
external connector or credentials are involved.
   
   ### Running Command
   
   JUnit format-level reproduction, using JDK 17 and the JSON format module. No 
engine job was run.
   
   ### Error Exception
   
   ```text
   java.lang.NullPointerException: Cannot invoke ObjectNode.get(String) because 
jsonNode is null
   ```
   
   ### Zeta or Flink or Spark Version
   
   Not involved in this format-level reproduction.
   
   ### Java or Scala Version
   
   OpenJDK 17.0.18.
   
   ### Are you willing to submit PR?
   
   - [x] Yes, I am willing to submit a PR.
   
   ### Code of Conduct
   
   - [x] I agree to follow the project's Code of Conduct.
   
   <sub>Reproduction and report prepared by an AI assistant for 
@hutiefang76.</sub>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to