snuyanzin commented on code in PR #29743:
URL: https://github.com/apache/flink/pull/29743#discussion_r4440471600


##########
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/formats/raw/RawFormatLineDelimiterTest.java:
##########
@@ -274,6 +276,23 @@ void testRoundTripNewlineDelimitedJsonAsVariant() throws 
Exception {
         
assertThat(rows.get(1).getVariant(0).getField("id").getByte()).isEqualTo((byte) 
2);
     }
 
+    @Test
+    void testDeserializeNewlineDelimitedJsonAsVariantWithoutDelimiterFails() 
throws Exception {
+        RawFormatDeserializationSchema deser =
+                new RawFormatDeserializationSchema(
+                        VARIANT_TYPE,
+                        TypeInformation.of(RowData.class),
+                        StandardCharsets.UTF_8.name(),
+                        true,
+                        null);
+        openDeser(deser);
+
+        byte[] message = 
"{\"id\":1}\n{\"id\":2}".getBytes(StandardCharsets.UTF_8);
+        assertThatThrownBy(() -> collectRows(deser, message))
+                .isInstanceOf(DeserializationException.class)
+                .hasMessageContaining("not a valid JSON document");

Review Comment:
   can we assert the exact content?



-- 
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