fsk119 commented on code in PR #21945:
URL: https://github.com/apache/flink/pull/21945#discussion_r1111508444
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/serde/LogicalTypeJsonSerializer.java:
##########
@@ -87,6 +89,10 @@ public final class LogicalTypeJsonSerializer extends
StdSerializer<LogicalType>
public static final String FIELD_NAME_CLASS = "class";
public static final String FIELD_NAME_SERIALIZER = "serializer";
+ // INTERVAL
Review Comment:
I just wonder whether it's better to serialize the INTERVAL type as follows:
```
{
"type": "INTERVAL",
"upperResolution": {
"precision": ...,
"intervalUnit": "..."
},
"lowerResolution": ...
}
```
So we can align with the API in `DataTypes#INTERVAL`. WDYT? @twalthr
@lincoln-lil
##########
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/serde/LogicalTypeJsonSerDeTest.java:
##########
@@ -71,23 +72,32 @@
/** Tests for {@link LogicalType} serialization and deserialization. */
@Execution(CONCURRENT)
-public class LogicalTypeJsonSerDeTest {
+class LogicalTypeJsonSerDeTest {
private final ObjectMapper mapper = buildObjectMapper();
@ParameterizedTest
@MethodSource("generateTestData")
Review Comment:
Please also add a test about the serialization/deserialization of the type.
##########
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/rest/serde/ResultInfoJsonSerDeTest.java:
##########
@@ -123,7 +131,7 @@ public void testResultInfoSerDeWithNullValues(RowFormat
rowFormat) throws Except
@ParameterizedTest
@ValueSource(strings = {"result_info_json_format.txt",
"result_info_plain_text_format.txt"})
Review Comment:
Could you also modify the JSON in the text to make sure others will not
break the serialization results in the future?
--
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]