Skip to content

Commit

Permalink
[Bug][scaleph-engine-sql-gateway] fix flink sql gateway query result …
Browse files Browse the repository at this point in the history
…error (#617)

fix: flink sql gateway query result error
  • Loading branch information
kalencaya authored Sep 7, 2023
1 parent 7c69906 commit 55102d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ public class WsFlinkSqlGatewayQueryResultDTO {

public static WsFlinkSqlGatewayQueryResultDTO fromResultSet(ResultSet resultSet) {
WsFlinkSqlGatewayQueryResultDTOBuilder builder = WsFlinkSqlGatewayQueryResultDTO.builder()
.resultType(resultSet.getResultType())
.resultKind(resultSet.getResultKind())
.jobID(resultSet.getJobID().toHexString());

if (resultSet.isQueryResult()) {
if (resultSet.getResultType() == ResultSet.ResultType.PAYLOAD || resultSet.getResultType() == ResultSet.ResultType.EOS) {
.resultType(resultSet.getResultType());
if (resultSet.getResultType() == ResultSet.ResultType.PAYLOAD || resultSet.getResultType() == ResultSet.ResultType.EOS) {
builder.resultKind(resultSet.getResultKind()).jobID(resultSet.getJobID().toHexString());
if (resultSet.isQueryResult()) {
List<Column> columns = resultSet.getResultSchema().getColumns();
builder.data(resultSet.getData().stream().map(rowData -> {
Map<String, Object> map = new HashMap<>();
Expand All @@ -79,10 +77,7 @@ public static WsFlinkSqlGatewayQueryResultDTO fromResultSet(ResultSet resultSet)
}
return map;
}).collect(Collectors.toList()));

if (resultSet.getResultType() == ResultSet.ResultType.PAYLOAD) {
builder.nextToken(resultSet.getNextToken());
}
builder.nextToken(resultSet.getNextToken());
}
}
return builder.build();
Expand Down
6 changes: 3 additions & 3 deletions tools/docker/mysql/init.d/scaleph-log-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ create table log_login
drop table if exists log_action;
create table log_action
(
id bigint not null auto_increment comment '自增主键',
id bigint not null auto_increment comment '自增主键',
user_name varchar(60) comment '用户名',
action_time timestamp not null comment '操作时间',
action_time timestamp not null comment '操作时间',
ip_address varchar(16) comment 'ip地址',
action_url varchar(128) not null comment '操作接口地址',
action_url text comment '操作接口地址',
token varchar(64) comment '会话token字符串',
client_info varchar(512) comment '客户端信息',
os_info varchar(128) comment '操作系统信息',
Expand Down

0 comments on commit 55102d0

Please sign in to comment.