Interface DataFrame
- All Superinterfaces:
Iterable<Row>,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentObject,org.opensearch.core.common.io.stream.Writeable
- All Known Implementing Classes:
AbstractDataFrame,DefaultDataFrame
public interface DataFrame
extends Iterable<Row>, org.opensearch.core.common.io.stream.Writeable, org.opensearch.core.xcontent.ToXContentObject
This is data interface used for data exchange between client plugins and ml plugins. Currently, only row based interface are provided,
since OpenSearch is using row similar based document to manage data.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new row given values array.voidAdd a new row given a Row dataGet the array of column metaintgetColumnIndex(String target) Find the index of the target in columnMetasgetRow(int index) Get Row data given index valueremove(int columnIndex) Build a new DataFrame by removing one column based on indexselect(int[] columns) Build a new DataFrame given the input columnsintsize()Get the size of the data frame.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.opensearch.core.xcontent.ToXContent
toXContentMethods inherited from interface org.opensearch.core.xcontent.ToXContentObject
isFragmentMethods inherited from interface org.opensearch.core.common.io.stream.Writeable
writeTo
-
Method Details
-
appendRow
Add a new row given values array.- Parameters:
values- input values
-
appendRow
Add a new row given a Row data- Parameters:
row- input row data
-
getRow
Get Row data given index value- Parameters:
index- index value- Returns:
- row data
-
size
int size()Get the size of the data frame. This is the row size actually.- Returns:
- the size
-
columnMetas
ColumnMeta[] columnMetas()Get the array of column meta- Returns:
- array of ColumnMeta
-
remove
Build a new DataFrame by removing one column based on index- Parameters:
columnIndex- the index of column- Returns:
- new DataFrame
-
select
Build a new DataFrame given the input columns- Parameters:
columns- the indices of column- Returns:
- new DataFrame
-
getColumnIndex
Find the index of the target in columnMetas- Parameters:
target- the string value of the target- Returns:
- column index of the target in the list of columnMetas
-