Skip to content

Fixed issues in the rest service module: BLOB, DATE, table model parameters, and added statistical delay monitoring items to FastLastQuery. #15917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

CloudWise-Lukemiao
Copy link
Contributor

The following issues have been fixed
1、When querying BLOB data type through the /rest/v2/query interface, the returned results display garbled characters. 2、For the DATE data type, it is recommended that the returned results be displayed with separators, such as: 2025-01-01. 3、Added statistical delay monitoring items to FastLastQuery. 4、Fixed the spelling error of the column_categories parameter in the insertTablet method of the table model.

1、When querying BLOB data type through the /rest/v2/query interface, the returned results display garbled characters.
2、For the DATE data type, it is recommended that the returned results be displayed with separators, such as: 2025-01-01.
3、Added statistical delay monitoring items to FastLastQuery.
4、Fixed the spelling error of the column_categories parameter in the insertTablet method of the table model.
@CritasWang CritasWang requested a review from Copilot July 15, 2025 06:12
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes BLOB and DATE formatting in REST query results, corrects the column_categories parameter typo across the table API, and adds latency monitoring for the new FastLastQuery endpoint.

  • Refactored result formatting to correctly handle TEXT, DATE, and BLOB types via a shared helper.
  • Renamed column_catogories to column_categories in OpenAPI spec, handlers, validation, construction, and examples.
  • Added FAST_LAST_QUERY to StatementType, wired up its latency tracking, and extended integration tests for date/blob support.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
iotdb-protocol/openapi/.../iotdb_rest_table_v1.yaml Fixed the column_categories typo in API schema
StatementType.java Added FAST_LAST_QUERY enum value
RestApiServiceImpl.java Captured statementType for FastLastQuery latency metrics
rest/v2/handler/QueryDataSetHandler.java Introduced addTypedValueToTarget to format TEXT, DATE, and BLOB
rest/v1/handler/QueryDataSetHandler.java Mirrored v2 formatting refactor for v1 responses
StatementConstructionHandler.java & RequestValidationHandler.java Updated InsertTablet handlers to use column_categories
integration-test/.../relational/it/rest/it/IoTDBRestServiceIT.java Corrected parameter name in JSON tests and added date/blob coverage
integration-test/.../it/IoTDBRestServiceIT.java Added end-to-end tests for DATE and BLOB on both v1 and v2 endpoints
example/rest-java-example/.../TableHttpExample.java and TableHttpsExample.java Updated example JSON to use column_categories
Comments suppressed due to low confidence (2)

integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java:355

  • [nitpick] The test method name 'inertDateAndBlob' appears to be a typo; consider renaming it to 'insertDateAndBlob' for clarity.
  public void inertDateAndBlob() {

integration-test/src/test/java/org/apache/iotdb/relational/it/rest/it/IoTDBRestServiceIT.java:150

  • This test only covers the v1 query path for date and BLOB types; consider adding a corresponding check against the /rest/v2 endpoint to ensure consistent behavior.
    inertDateAndBlob();

@@ -258,6 +255,30 @@ private static Response fillQueryDataSetWithoutTimestamps(
return Response.ok().entity(targetDataSet).build();
}

private static void addTypedValueToTarget(
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

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

[nitpick] The addTypedValueToTarget logic is duplicated across REST v1, v2, and table handlers. Consider extracting it into a shared utility class to reduce code duplication and simplify future updates.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the codes for two versions, v1 and v2. To better and flexibly respond to future version changes, the choice of independent logic is made.

@@ -116,6 +115,30 @@ public static Response fillQueryDataSet(
return Response.ok().entity(targetDataSet).build();
}

private static void addTypedValueToTarget(
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

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

[nitpick] This addTypedValueToTarget method repeats the same logic as in the REST v2 handler. Extracting it into a common helper would improve maintainability.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the codes for two versions, v1 and v2. To better and flexibly respond to future version changes, the choice of independent logic is made.

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.

1 participant