{"record":{"id":"508941237d2ab98f","repo":"apache/cassandra","slug":"the-s-virtual-table-is-deprecated-please-use","errorCode":null,"errorMessage":"The \"%s\" virtual table is deprecated. Please, use either \"%s.batch_group\", or \"%s.type_histogram\" virtual tables instead.","messagePattern":"The \"(.+?)\" virtual table is deprecated\\. Please, use either \"(.+?)\\.batch_group\", or \"(.+?)\\.type_histogram\" virtual tables instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/db/virtual/BatchMetricsTable.java","lineNumber":71,"sourceCode":"                           .partitioner(new LocalPartitioner(UTF8Type.instance))\n                           .addPartitionKeyColumn(\"name\", UTF8Type.instance)\n                           .addRegularColumn(P50, DoubleType.instance)\n                           .addRegularColumn(P99, DoubleType.instance)\n                           .addRegularColumn(P999, DoubleType.instance)\n                           .addRegularColumn(MAX, LongType.instance)\n                           .build());\n    }\n\n    @Override\n    public DataSet data()\n    {\n        SimpleDataSet result = new SimpleDataSet(metadata());\n        BatchMetrics metrics = BatchStatement.metrics;\n        addRow(result, PARTITIONS_PER_LOGGED_BATCH, metrics.partitionsPerLoggedBatch.getSnapshot());\n        addRow(result, PARTITIONS_PER_UNLOGGED_BATCH, metrics.partitionsPerUnloggedBatch.getSnapshot());\n        addRow(result, PARTITIONS_PER_COUNTER_BATCH, metrics.partitionsPerCounterBatch.getSnapshot());\n\n        ClientWarn.instance.warn(String.format(\"The \\\"%s\\\" virtual table is deprecated. \" +\n                                               \"Please, use either \\\"%s.batch_group\\\", or \\\"%s.type_histogram\\\" \" +\n                                               \"virtual tables instead.\",\n                                               TABLE_NAME, metadata.keyspace, metadata.keyspace));\n        return result;\n    }\n\n    private void addRow(SimpleDataSet dataSet, String name, Snapshot snapshot)\n    {\n        dataSet.row(name)\n               .column(P50, snapshot.getMedian())\n               .column(P99, snapshot.get99thPercentile())\n               .column(P999, snapshot.get999thPercentile())\n               .column(MAX, snapshot.getMax());\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/virtual/BatchMetricsTable.java#L53-L87","documentation":"BatchMetricsTable.data() emits a ClientWarn deprecation notice when the deprecated per-batch virtual table is queried, telling the user to use '<keyspace>.batch_group' or '<keyspace>.type_histogram' instead. The query still returns the legacy metric rows; the warning is purely informational.","triggerScenarios":"Any SELECT against the deprecated batch metrics virtual table (system_metrics.batch_metrics / similar TABLE_NAME) triggers the warning string with the table and keyspace names interpolated.","commonSituations":"Monitoring scripts or dashboards written against the old virtual table after it was deprecated in favor of the newer grouped metrics tables; documentation or tutorials referencing the legacy table.","solutions":["Rewrite queries to use the <keyspace>.batch_group virtual table.","Use the <keyspace>.type_histogram virtual table for per-type batch partition histograms.","Update monitoring tooling/dashboards to the new tables so warnings stop appearing."],"exampleFix":"// before\nSELECT * FROM system_metrics.batch_metrics;\n\n// after\nSELECT * FROM system_metrics.batch_group;\nSELECT * FROM system_metrics.type_histogram;","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use system_metrics.batch_group and system_metrics.type_histogram in all new tooling.","Grep monitoring configs for deprecated virtual table names during upgrades.","Read release notes for virtual table deprecations."],"tags":["deprecation","virtual-table","metrics"],"backgroundTag":"deprecated-api-usage","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}