fsk119 commented on a change in pull request #12756:
URL: https://github.com/apache/flink/pull/12756#discussion_r450849400



##########
File path: 
flink-formats/flink-json/src/test/java/org/apache/flink/formats/json/JsonRowDataSerDeSchemaTest.java
##########
@@ -502,9 +516,17 @@ private void testParseErrors(TestSpec spec) throws 
Exception {
                        .json("{\"map\":{\"key1\":\"123\", \"key2\":\"abc\"}}")
                        .rowType(ROW(FIELD("map", MAP(STRING(), INT()))))
                        .expect(Row.of(createHashMap("key1", 123, "key2", 
null)))
-                       .expectErrorMessage("Failed to deserialize JSON 
'{\"map\":{\"key1\":\"123\", \"key2\":\"abc\"}}'")
+                       .expectErrorMessage("Failed to deserialize JSON 
'{\"map\":{\"key1\":\"123\", \"key2\":\"abc\"}}'"),
 
+               TestSpec
+                       .json("{\"id\":\"2019-11-12T18:00:12\"}")
+                       .rowType(ROW(FIELD("id", 
TIMESTAMP_WITH_LOCAL_TIME_ZONE(0))))
+                       .expectErrorMessage("Failed to deserialize JSON 
'{\"id\":\"2019-11-12T18:00:12\"}'"),
 
+               TestSpec
+                       .json("{\"id\":\"2019-11-12T18:00:12\"}")
+                       .rowType(ROW(FIELD("id", 
TIMESTAMP_WITH_LOCAL_TIME_ZONE(0))))
+                       .expectErrorMessage("Failed to deserialize JSON 
'{\"id\":\"2019-11-12T18:00:12+0800\"}'")

Review comment:
       It seems the Thrown's problem. It will match substring rather than the 
whole string and "2019-11-12T18:00:12" is the substring of 
"2019-11-12T18:00:12+0800". Therefore, we pass the test here. 




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to