Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.18.1
-
None
-
None
-
- Locally executed, without Flink cluster.
- Flink on Kubernetes
Description
Steps to reproduce:
- Create ConfluentRegistryAvroDeserializationSchema instance for specific Avro
- Parse invalid byte representation of serialized Avro event
- Parse valid byte representation of serialized Avro event
Expected:
Validation in step 3 is successful
Actual:
Validation in step 3 fails
Short code example, I cannot attach full examples at this time:
```
public class DeserializationTest {
public static void main(String[] args) throws Exception {
byte[] valid = new byte[]
;
byte[] invalid = new byte[]
;
ConfluentRegistryAvroDeserializationSchema<RawEvent> deserializer = ConfluentRegistryAvroDeserializationSchema.forSpecific(RawEvent.class, valid schema registry url);
System.out.println("deserialize valid");
des(deserializer, valid);
System.out.println("deserialize invalid");
des(deserializer, invalid);
System.out.println("deserialize valid");
des(deserializer, valid);
System.out.println("deserialize valid");
des(deserializer, valid);
}
private static void des(ConfluentRegistryAvroDeserializationSchema<RawEvent> deserializer, byte[] bytes) {
try
catch (Exception e)
{ System.out.println("FAILED: " + e); } }
}
```
Console output:
```
deserialize valid
VALID
deserialize invalid
FAILED: java.lang.ArrayIndexOutOfBoundsException: Index -154 out of bounds for length 2
deserialize valid
FAILED: java.lang.ArrayIndexOutOfBoundsException: Index 24 out of bounds for length 2
deserialize valid
FAILED: java.lang.ArrayIndexOutOfBoundsException: Index 25 out of bounds for length 2
```