{"record":{"id":"28d4266b56420bca","repo":"apache/seatunnel","slug":"no-result-returned-after-running-query-rowcount-28d426","errorCode":null,"errorMessage":"No result returned after running query [${rowCountQuery}]","messagePattern":"No result returned after running query \\[(.+?)\\]","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java","lineNumber":238,"sourceCode":"            String rowCountQuery =\n                    String.format(\n                            \"select NUM_ROWS from all_tables where OWNER = '%s' AND TABLE_NAME = '%s' \",\n                            tablePath.getSchemaName(), tablePath.getTableName());\n            try (Statement stmt = connection.createStatement()) {\n                String analyzeTable =\n                        String.format(\n                                \"analyze table %s compute statistics for table\",\n                                tableIdentifier(tablePath));\n                if (!table.getSkipAnalyze()) {\n                    log.info(\"Split Chunk, approximateRowCntStatement: {}\", analyzeTable);\n                    stmt.execute(analyzeTable);\n                } else {\n                    log.warn(\"Skip analyze, approximateRowCntStatement: {}\", analyzeTable);\n                }\n                log.info(\"Split Chunk, approximateRowCntStatement: {}\", rowCountQuery);\n                try (ResultSet rs = stmt.executeQuery(rowCountQuery)) {\n                    if (!rs.next()) {\n                        throw new SQLException(\n                                String.format(\n                                        \"No result returned after running query [%s]\",\n                                        rowCountQuery));\n                    }\n                    return rs.getLong(1);\n                }\n            }\n        }\n        return SQLUtils.countForSubquery(connection, query);\n    }\n\n    @Override\n    public Object queryNextChunkMax(\n            Connection connection,\n            JdbcSourceTable table,\n            String columnName,\n            int chunkSize,\n            Object includedLowerBound)","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java#L220-L256","documentation":"Thrown by YashanDbDialect.approximateRowCntStatement when the approximate row-count query returns no rows. The chunk splitter requires a row count to size splits, so an empty result is surfaced as a SQLException.","triggerScenarios":"Splitting a YashanDB table when the statistics/count query matches no rows — table does not exist, user lacks catalog privileges, or analyze/statistics step failed and the count query sees nothing.","commonSituations":"Connecting with a low-privilege user that cannot see the table's statistics; wrong schema/table path; very newly created tables without visible stats.","solutions":["Verify the table path/schema is correct and the table exists","Grant the connector user privileges to read table statistics/catalog views","Run the row-count query manually on YashanDB to reproduce","Ensure the analyze step succeeded — check the earlier 'Skip analyze' WARN logs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"-- Run the same count query the dialect uses before splitting\nSELECT COUNT(*) FROM yashan_user.your_table;","typeGuard":null,"tryCatchPattern":"try {\n    source.open();\n} catch (SQLException e) {\n    if (e.getMessage().startsWith(\"No result returned after running query\")) {\n        // check table existence and privileges\n    }\n}","preventionTips":["Grant catalog/statistics read privileges to the connector user","Confirm the table path/schema is exact","Watch for the 'Skip analyze' WARN and address analyze failures"],"tags":["jdbc","yashandb","split-reading","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}