public static long queryApproximateRowCnt(JdbcConnection jdbc, TableId tableId)
            throws SQLException {
        final String analyzeTable =
                String.format(
                        "analyze table %s compute statistics for table",
                        quoteSchemaAndTable(tableId));
        final String rowCountQuery =
                String.format(
                        "select NUM_ROWS from all_tables where TABLE_NAME = '%s'", tableId.table());
        return jdbc.execute(analyzeTable)
                .queryAndMap(
                        rowCountQuery,
                        rs -> {
                            if (!rs.next()) {
                                throw new SQLException(
                                        String.format(
                                                "No result returned after running query [%s]",
                                                rowCountQuery));
                            }
                            return rs.getLong(1);
                        });
    }
Utils to prepare Oracle SQL statement.
 Copy from com.ververica:flink-connector-oracle-cdc:2.3.0
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/source/utils/OracleUtils.java