{"record":{"id":"800468f5fd141435","repo":"apache/seatunnel","slug":"skip-analyze-approximaterowcntstatement","errorCode":null,"errorMessage":"Skip analyze, approximateRowCntStatement: {}","messagePattern":"Skip analyze, approximateRowCntStatement: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbDialect.java","lineNumber":233,"sourceCode":"            }\n        }\n\n        if (useTableStats) {\n            TablePath tablePath = table.getTablePath();\n            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(","sourceCodeStart":215,"sourceCodeEnd":251,"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#L215-L251","documentation":"Info/warn log in YashanDbDialect.approximateRowCntStatement indicating the ANALYZE TABLE step for row-count estimation was skipped because the table config has skipAnalyze=true. Splitting then relies on a plain COUNT(*) query instead of optimizer statistics. It is not an error; the job continues.","triggerScenarios":"JDBC source read from YashanDB where the table options set skipAnalyze=true, so `analyze table ... compute statistics for table` is not executed before the row-count query.","commonSituations":"Users disabling analyze to avoid locking or stats overhead on large/production tables during split enumeration; ops teams restricting ANALYZE privileges.","solutions":["No action needed if skipping is intentional; the COUNT-based row estimate still runs.","Remove skipAnalyze=true from the table options if you want faster/more accurate split estimation.","If ANALYZE is undesired globally, tune split size explicitly (query-based splitting config) instead."],"exampleFix":"// before\npartition_column-analyze=true (analyze enabled)\n// after (skip analyze)\ntable-path = \"db.tbl\"\nskip_analyze = true","handlingStrategy":"validation","validationCode":"// ensure skipAnalyze is intentional\nboolean skip = tableOptions.getSkipAnalyze();\nif (!skip) log.info(\"ANALYZE will run for {}\", tablePath);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only set skipAnalyze=true when ANALYZE privileges/locking are a concern","Prefer explicit split size config when skipping analyze on huge tables","Confirm the COUNT(*) fallback meets your split-accuracy needs"],"tags":["jdbc","yashandb","split-enumeration","analyze"],"backgroundTag":"skipped-operation","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"}