Skip to content

Support SHOW DELETE TIMESERIES PROGRESS in REST v1 queries - #19538

Draft
Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:codex/rest-delete-progress-20261204
Draft

Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:codex/rest-delete-progress-20261204

Conversation

@Caideyipi

@Caideyipi Caideyipi commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Route SHOW DELETE TIMESERIES PROGRESS through REST v1's query path and serialize its result as a query dataset.

Example

Request:
POST /rest/v1/query
{"sql":"SHOW DELETE TIMESERIES PROGRESS"}

Before: REST v1 classifies the statement as an execution statement and rejects it on the query endpoint.
After: REST v1 returns the 8-column progress dataset, including ProcedureId and zero or more progress rows.

Tests

  • Unit: QueryDataSetHandlerTest#showDeleteTimeSeriesProgressIsAllowedAsQuery
  • Integration: IoTDBRestServiceIT#showDeleteTimeSeriesProgressIsQueryableThroughRestV1

Split out from #19523.


public static boolean validateStatement(Statement statement) {
return !(statement instanceof QueryStatement)
&& !(statement instanceof ShowDeleteTimeSeriesProgressStatement)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v1/handler/ExecuteStatementHandler.java:37 — Query path still rejects SHOW DELETE TIMESERIES PROGRESS: fillQueryDataSet has no branch for it

After this change SHOW DELETE TIMESERIES PROGRESS reaches the REST v1 query endpoint, but QueryDataSetHandler.fillQueryDataSet (v1, lines 61-84) only special-cases ShowStatement/ShowModels/ShowAIDevices/ShowLoadedModels/AuthorStatement/GetRegionIdStatement and QueryStatement; ShowDeleteTimeSeriesProgressStatement (extends Statement, implements IConfigStatement) falls through to the fallback branch and returns QUERY_PROCESS_ERROR "unsupported query data type", so the feature does not work. The non-query endpoint simultaneously regresses from SUCCESS_STATUS to EXECUTE_STATEMENT_ERROR.

Fix: Add statement instanceof ShowDeleteTimeSeriesProgressStatement to the fillShowPlanDataSet branch in external-service-impl/rest/.../v1/handler/QueryDataSetHandler.java, mirroring the validator change (and v2 for parity).

public class QueryDataSetHandlerTest {

@Test
public void showDeleteTimeSeriesProgressIsAllowedAsQuery() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor external-service-impl/rest/src/test/java/org/apache/iotdb/rest/protocol/v1/handler/QueryDataSetHandlerTest.java:55 — New test only asserts validateStatement and never exercises fillQueryDataSet

showDeleteTimeSeriesProgressIsAllowedAsQuery asserts only assertFalse(ExecuteStatementHandler.validateStatement(...)), so it passes even though QueryDataSetHandler.fillQueryDataSet still returns a QUERY_PROCESS_ERROR for this statement type. The regression is invisible to the test suite.

Fix: Extend the test to call QueryDataSetHandler.fillQueryDataSet(new TestQueryExecution(...), new ShowDeleteTimeSeriesProgressStatement(), limit) and assert a QueryDataSet with the expected column names is returned.

@Caideyipi
Caideyipi marked this pull request as draft December 4, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants