pyscala commented on a change in pull request #13834:
URL: https://github.com/apache/flink/pull/13834#discussion_r521297859



##########
File path: 
flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvRowDataSerDeSchemaTest.java
##########
@@ -320,6 +339,34 @@ private void testField(
                assertEquals(expectedCsv, new String(serializedRow));
        }
 
+       private void testFieldForTime(

Review comment:
       i will clean up

##########
File path: 
flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvRowDataSerDeSchemaTest.java
##########
@@ -150,6 +151,24 @@ public void testSerializeDeserializeCustomizedProperties() 
throws Exception {
                        deserConfig,
                        ";");
                testField(STRING(), "null", "null", serConfig, deserConfig, 
";"); // string because null literal has not been set
+               testField(TIME(3), "12:12:12.232", 
LocalTime.parse("12:12:12.232") , deserConfig , ";");
+               testField(TIME(3), "12:12:12.232342", 
LocalTime.parse("12:12:12.232") , deserConfig , ";");
+               testField(TIME(3), "12:12:12.23", 
LocalTime.parse("12:12:12.23") , deserConfig , ";");
+               testField(TIME(2), "12:12:12.23", 
LocalTime.parse("12:12:12.23") , deserConfig , ";");
+               testField(TIME(2), "12:12:12.232312", 
LocalTime.parse("12:12:12.23") , deserConfig , ";");
+               testField(TIME(2), "12:12:12.2", LocalTime.parse("12:12:12.2") 
, deserConfig , ";");
+               testField(TIME(1), "12:12:12.2", LocalTime.parse("12:12:12.2") 
, deserConfig , ";");
+               testField(TIME(1), "12:12:12.2235", 
LocalTime.parse("12:12:12.2") , deserConfig , ";");
+               testField(TIME(1), "12:12:12", LocalTime.parse("12:12:12") , 
deserConfig , ";");
+               testField(TIME(0), "12:12:12", LocalTime.parse("12:12:12") , 
deserConfig , ";");
+               testField(TIME(0), "12:12:12.45", LocalTime.parse("12:12:12") , 
deserConfig , ";");
+               int precision = 5;
+               String expectedMessage = String.format("Csv does not support 
TIME type with precision: %d, it only supports precision 0 ~ 3.", precision);

Review comment:
       fix it




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