fix(gbase8a): 优化 agent 启动错误提示

This commit is contained in:
zipg authored and GitHub committed 2026-06-28 10:31:59 +08:00
1 parent fa55fa0d8a
commit be996a4352
13 files changed
+120 -27

No files matched your search

@@ -1,8 +1,12 @@
package com.dbx.agent.gbase8a;
import com.dbx.agent.ConfiguredJdbcAgent;
import com.dbx.agent.ExecuteQueryOptions;
import com.dbx.agent.JdbcAgentProfile;
import com.dbx.agent.JsonRpcServer;
import com.dbx.agent.QueryPageOptions;
import com.dbx.agent.QueryPageResult;
import com.dbx.agent.QueryResult;
import com.dbx.agent.TableInfo;
import java.sql.PreparedStatement;
@@ -31,6 +35,21 @@ public final class Gbase8aAgent extends ConfiguredJdbcAgent {
super(GBASE8A_PROFILE);
}
@Override
public QueryResult executeQuery(String sql, String schema, ExecuteQueryOptions options) {
return super.executeQuery(sql, schema, withoutFetchSize(options));
}
@Override
public QueryPageResult executeQueryPage(String sql, String schema, QueryPageOptions options) {
return super.executeQueryPage(sql, schema, withoutFetchSize(options));
}
@Override
public QueryPageResult startTableRead(String sql, String schema, QueryPageOptions options) {
return super.startTableRead(sql, schema, withoutFetchSize(options));
}
@Override
public List<TableInfo> listTables(String schema) {
return unchecked(() -> {
@@ -60,6 +79,14 @@ public final class Gbase8aAgent extends ConfiguredJdbcAgent {
});
}
private static ExecuteQueryOptions withoutFetchSize(ExecuteQueryOptions options) {
return new ExecuteQueryOptions(options.getMaxRows(), null, options.getTimeoutSecs());
}
private static QueryPageOptions withoutFetchSize(QueryPageOptions options) {
return new QueryPageOptions(options.getPageSize(), null, options.getMaxRows(), options.getTimeoutSecs());
}
public static void main(String[] args) {
new JsonRpcServer(new Gbase8aAgent()).run();
}