FangYongs commented on code in PR #22832:
URL: https://github.com/apache/flink/pull/22832#discussion_r1243176991
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/serde/ResultInfo.java:
##########
@@ -57,19 +58,24 @@ public class ResultInfo {
private final List<ColumnInfo> columnInfos;
private final List<RowData> data;
private final RowFormat rowFormat;
+ private final ZoneId zoneId;
- ResultInfo(List<ColumnInfo> columnInfos, List<RowData> data, RowFormat
rowFormat) {
+ ResultInfo(
+ List<ColumnInfo> columnInfos, List<RowData> data, RowFormat
rowFormat, ZoneId zoneId) {
this.columnInfos = columnInfos;
this.data = data;
this.rowFormat = rowFormat;
+ this.zoneId = zoneId;
}
public static ResultInfo createResultInfo(ResultSet resultSet, RowFormat
rowFormat) {
Preconditions.checkArgument(resultSet.getResultType() !=
ResultSet.ResultType.NOT_READY);
List<RowData> data = resultSet.getData();
+ ZoneId zoneId = ZoneId.systemDefault();
switch (rowFormat) {
case JSON:
+ zoneId = ((ResultSetImpl) resultSet).getZoneId();
Review Comment:
When `RowDataToStringConverterImpl` convert rowdata to string, it will
convert timestamp_ltz data to string according to the local zone id in
`TimestampToStringCastRule`. In addition to passing the zone id to the jdbc
driver, add a converter similar to `RowDataToStringConverter` for the JSON
format and convert the data first in the gateway may be a better way. What do
you think?
--
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]