mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
[ML-Dataframe] Add Data Frame client to the Java HLRC (#39921)
Adds DataFrameClient to the Java HLRC and implements PUT and DELETE data frame transform.
This commit is contained in:
parent
300ae485dd
commit
2cb8b65ce6
16 changed files with 937 additions and 4 deletions
|
@ -0,0 +1,25 @@
|
|||
--
|
||||
:api: delete-data-frame-transform
|
||||
:request: DeleteDataFrameTransformRequest
|
||||
:response: AcknowledgedResponse
|
||||
--
|
||||
[id="{upid}-{api}"]
|
||||
=== Delete Data Frame Transform API
|
||||
|
||||
[id="{upid}-{api}-request"]
|
||||
==== Delete Data Frame Transform Request
|
||||
|
||||
A +{request}+ object requires a non-null `id`.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
---------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-request]
|
||||
---------------------------------------------------
|
||||
<1> Constructing a new request referencing an existing {dataframe-transform}
|
||||
|
||||
include::../execution.asciidoc[]
|
||||
|
||||
[id="{upid}-{api}-response"]
|
||||
==== Response
|
||||
|
||||
The returned +{response}+ object acknowledges the Data Frame Transform deletion.
|
93
docs/java-rest/high-level/dataframe/put_data_frame.asciidoc
Normal file
93
docs/java-rest/high-level/dataframe/put_data_frame.asciidoc
Normal file
|
@ -0,0 +1,93 @@
|
|||
--
|
||||
:api: put-data-frame-transform
|
||||
:request: PutDataFrameTransformRequest
|
||||
:response: AcknowledgedResponse
|
||||
--
|
||||
[id="{upid}-{api}"]
|
||||
=== Put Data Frame Transform API
|
||||
|
||||
The Put Data Frame Transform API is used to create a new {dataframe-transform}.
|
||||
|
||||
The API accepts a +{request}+ object as a request and returns a +{response}+.
|
||||
|
||||
[id="{upid}-{api}-request"]
|
||||
==== Put Data Frame Request
|
||||
|
||||
A +{request}+ requires the following argument:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-request]
|
||||
--------------------------------------------------
|
||||
<1> The configuration of the {dataframe-job} to create
|
||||
|
||||
[id="{upid}-{api}-config"]
|
||||
==== Data Frame Transform Configuration
|
||||
|
||||
The `DataFrameTransformConfig` object contains all the details about the {dataframe-transform}
|
||||
configuration and contains the following arguments:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-config]
|
||||
--------------------------------------------------
|
||||
<1> The {dataframe-transform} ID
|
||||
<2> The source index or index pattern
|
||||
<3> The destination index
|
||||
<4> Optionally a QueryConfig
|
||||
<5> The PivotConfig
|
||||
|
||||
[id="{upid}-{api}-query-config"]
|
||||
==== QueryConfig
|
||||
|
||||
The query with which to select data from the source.
|
||||
If not set a `match_all` query is used by default.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-query-config]
|
||||
--------------------------------------------------
|
||||
|
||||
==== PivotConfig
|
||||
|
||||
Defines the pivot function `group by` fields and the aggregation to reduce the data.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-pivot-config]
|
||||
--------------------------------------------------
|
||||
|
||||
===== GroupConfig
|
||||
The grouping terms. Defines the group by and destination fields
|
||||
which are produced by the pivot function. There are 3 types of
|
||||
groups
|
||||
|
||||
* Terms
|
||||
* Histogram
|
||||
* Date Histogram
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-group-config]
|
||||
--------------------------------------------------
|
||||
<1> The destination field
|
||||
<2> Group by values of the `user_id` field
|
||||
|
||||
===== AggregationConfig
|
||||
|
||||
Defines the aggregations for the group fields.
|
||||
// TODO link to the supported aggregations
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests-file}[{api}-agg-config]
|
||||
--------------------------------------------------
|
||||
<1> Aggregate the average star rating
|
||||
|
||||
include::../execution.asciidoc[]
|
||||
|
||||
[id="{upid}-{api}-response"]
|
||||
==== Response
|
||||
|
||||
The returned +{response}+ acknowledges the successful creation of
|
||||
the new {dataframe-transform} or an error if the configuration is invalid.
|
|
@ -550,3 +550,16 @@ include::ilm/stop_lifecycle_management.asciidoc[]
|
|||
include::ilm/lifecycle_management_status.asciidoc[]
|
||||
include::ilm/retry_lifecycle_policy.asciidoc[]
|
||||
include::ilm/remove_lifecycle_policy_from_index.asciidoc[]
|
||||
|
||||
== Data Frame APIs
|
||||
|
||||
:upid: {mainid}-dataframe
|
||||
:doc-tests-file: {doc-tests}/DataFrameTransformDocumentationIT.java
|
||||
|
||||
The Java High Level REST Client supports the following Data Frame APIs:
|
||||
|
||||
* <<{upid}-put-data-frame-transform>>
|
||||
* <<{upid}-delete-data-frame-transform>>
|
||||
|
||||
include::dataframe/put_data_frame.asciidoc[]
|
||||
include::dataframe/delete_data_frame.asciidoc[]
|
Loading…
Add table
Add a link
Reference in a new issue