Hisoka-X commented on code in PR #5833:
URL: https://github.com/apache/seatunnel/pull/5833#discussion_r1404705395
##########
seatunnel-connectors-v2/connector-amazonsqs/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazonsqs/deserialize/AmazonSqsDeserializer.java:
##########
@@ -33,8 +39,19 @@ public
AmazonSqsDeserializer(DeserializationSchema<SeaTunnelRow> deserialization
@Override
public SeaTunnelRow deserializeRow(String row) {
try {
- return deserializationSchema.deserialize(row.getBytes());
+ List<SeaTunnelRow> seaTunnelRows =
deserializationSchema.deserialize(row.getBytes());
+ if (CollectionUtils.isEmpty(seaTunnelRows)) {
+ log.warn("The AmazonSqsDeserializer deserialize result is
empty");
+ return null;
+ }
+ if (seaTunnelRows.size() != 1) {
+ log.warn(
+ "The AmazonSqsDeserializer only support one row, but
got {} rows, will drop the extra rows",
+ seaTunnelRows.size());
+ }
Review Comment:
I think throw exception would be better.
--
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]