arrow-flight-sql 查询数据,返回的数据量和count的数据量每次都不一致

Viewed 76

使用原生jdbc获取数据量10006。
image.png
arrow-flight-sql求的count和select数据的行数对不齐,且都小于原生jdbc获取的行数。

    public static void main(String[] args) throws Throwable {
        Class.forName("org.apache.arrow.driver.jdbc.ArrowFlightJdbcDriver");
        final Connection connection = DriverManager.getConnection("jdbc:arrow-flight-sql://host:port?useServerPrepStmts=false&cachePrepStmts=true&useSSL=false&useEncryption=false", "xxx", "x*SD.x"
        );
        final Statement statement = connection.createStatement();
        final ResultSet resultSet1 = statement.executeQuery("use cdp_tech_dev; select count(1) from (" + sql + ") d");
        final RunQueryResult build1 = RunQueryResult.builder().data(new ArrayList<>()).build();
        build1.resolveColumns(resultSet1);
        build1.addData(resultSet1);
        System.out.println("size: " + build1.getData().get(0).get(0));
        final ResultSet resultSet = statement.executeQuery("use cdp_tech_dev;" + sql);
        final RunQueryResult build = RunQueryResult.builder().data(new ArrayList<>()).build();
        build.resolveColumns(resultSet);
        build.addData(resultSet);
        System.out.println("fetch detail size: " + build.getData().size());
    }

count:
第一次执行
image.png
第二次执行
image.png

select list count
第一次执行
image.png
第二次执行
image.png

2 Answers

升级 doris 到 2.1.6 试试,2.1.6修了一个bug,可能会影响这个

如果还不行,贴下 show create table 建表语句,我复现下试试

版本信息:
flight-sql-jdbc-core: 15.0.1
doris: 2.1.5