Repository navigation
[core][python] Add asynchronous prediction REST APIs - #11012
XiaoHongbo-Hope wants to merge 1 commit into
Conversation
062f66b to
ba1769d
Compare
|
Thanks for putting together the Java and Python prediction contracts. I ran the client and REST-contract tests from this head. They exercise request encoding and mocked lifecycle responses. The proposed workflow depends on a provider to submit and execute an actual job, read the pinned snapshot, publish the result table, and handle cancellation. This change leaves that provider work outside its scope, so the current patch does not give a Paimon user a deployable prediction workflow. I'm closing this version. Please bring it back with a linked provider implementation or an executable reference integration that demonstrates submission through result readback, including the snapshot and cancellation behavior. |
|
The new reference integration covers the snapshot and cancellation checks from the previous review. I ran the real Paimon source-to-result test as part of 308 passing JVM tests, and 27 Python tests passed. The execution handler is packaged only with the MockWebServer tests. It checks that the model identifier exists, then writes the submitted input fields back as JSON. The published artifacts provide the REST clients and contract, and this PR links no provider that can execute a registered model. That leaves the production prediction workflow incomplete. I’m closing this iteration. Please reopen with a deployable provider or a linked provider change that runs a registered model through submission, snapshot-bound execution, result readback, and cancellation. |
799eeaf to
86ff51b
Compare
Should we just define a provider SPI or also include a concrete implementation? |
Add prediction lifecycle APIs for REST Catalog clients and a ModelProvider SPI with a runnable reference integration.
86ff51b to
c265112
Compare
Purpose
Add provider-neutral asynchronous predictions for registered Models. A public
ModelProviderSPI and the publishedReferenceModelProviderprovide an executable local workflow without embedding model logic in the REST test server.API
table.predict()submits a prediction and returnsPredictionWait.result(timeout)polls until the deadline. The deadline is checked between REST requests and does not cancel the server-side prediction./v1/{prefix}/predictions.idempotencyTokenby default; callers may supply one for retries.x-request-idremains a tracing identifier.scan.snapshot-idorscan.tag-name.outputis optional. The default managed table contains source identity columns,response, anderror.Strict request cancellation and an end-to-end HTTP deadline are generic client concerns and are out of scope.
Lifecycle
state:PENDING,RUNNING,TERMINATING, orTERMINATED.terminationDetailscontains the result code and optional message.startTimeandendTimedescribe execution time.TERMINATING.Industry references
responseanderrorPaimon-specific choices are the Catalog-scoped resource, structured Model identifier, table source, and snapshot/tag options.
Reference integration
paimon-apipublishes theModelProviderSPI.paimon-corepublishes a discoverable reference provider (provider=reference,model=sample). The REST reference executor resolves the registered Model, validates it through the provider, reads the recorded source snapshot, invokes the provider for every input row, and writes a managed Paimon result table.The integration verifies:
TERMINATED/CANCELEDwithout publishing an output table.Tests
git diff --checkpassed.