Closed discord9 closed 1 month ago
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
This update enhances the project's capabilities by introducing new features and improving existing functionality. Key changes include the addition of flow service handling, modifications to asynchronous functions, and updates to dependency management. These alterations aim to streamline data processing and error handling within the system.
File(s) | Change Summary |
---|---|
Cargo.toml, src/common/function/Cargo.toml | Updated greptime-proto dependency version; added futures.workspace and futures-util.workspace . |
src/cmd/src/cli/repl.rs | Modified create_query_engine function to accept an additional parameter. |
src/common/function/src/flush_flow.rs | Introduced a new flush_flow asynchronous function for flow data management. |
src/common/function/src/handlers.rs | Added FlowServiceHandler trait for flushing operations in flow services. |
src/common/function/src/lib.rs | New module flush_flow added to the library. |
src/common/function/src/state.rs | Enhanced FunctionState struct with flow_service_handler . |
src/query/src/query_engine.rs | Updated QueryEngineFactory constructors to include a new optional parameter for flow services. |
src/operator/src/flow.rs | Defined FlowServiceOperator struct implementing FlowServiceHandler . |
tests/cases/standalone/common/flow/flow_basic.sql | Introduced SQL scripts for creating tables and flows to process numerical data. |
tests/cases/standalone/common/flow/show_create_flow.sql | Renamed tables and flows to reflect new naming conventions. |
sequenceDiagram
participant User
participant FlowService
participant QueryEngine
participant DataStore
User->>FlowService: Initiate flush operation
FlowService->>QueryEngine: Request flush
QueryEngine->>DataStore: Execute data flush
DataStore-->>QueryEngine: Acknowledge completion
QueryEngine-->>FlowService: Flush completed
FlowService-->>User: Respond with status
π In the meadow, I hop with glee,
New flows and functions, oh such a spree!
With futures added, we dance and play,
Flushing data brightens the day!
Hooray for changes, letβs celebrate,
In code we trust, our dreams await! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@coderabbitai review
Attention: Patch coverage is 54.35540%
with 131 lines
in your changes missing coverage. Please review.
Project coverage is 84.70%. Comparing base (
f787265
) to head (ce18dc2
). Report is 13 commits behind head on main.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
What's changed and what's your intention?
added a admin function
flush_flow
, which will signal flow worker to flush flow immediately and write newest results to sink table.flush_flow
admin_fn, also tweakadmin_fn
macro to support itadmin_fn
macro and use as many full path as possibleFlowServiceOperator
to support flush flow in contextflush_flow
For ease of reviewing, the major changes are listed in the following files, others are just mostly adding new args when creating
QueryEngine
:src/common/function/src/flush_flow.rs
for implflush_flow
function in sqlsrc/flow/src/adapter/flownode_impl.rs
to impl flush flow in flow worker, note it will first sleep for 100 ms now before doing anything to prevent running flush before inputs are send to flowsrc/common/function/src/handlers.rs
andsrc/operator/src/flow.rs
whichimpl FlowServiceHandler for FlowServiceOperator
sqlness tests that change
SQLNESS SLEEP <TIME>
toselect flush_flow('test_numbers_basic')*0;
Checklist
[ ] I have written the necessary rustdoc comments.
[ ] I have added the necessary unit tests and integration tests.
[x] This PR requires documentation updates.
Summary by CodeRabbit
New Features
FlowServiceHandler
andFlowServiceOperator
for improved flow management.Bug Fixes
Documentation
admin_fn
macro to include support forFlowServiceHandlerRef
.Chores