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.Params

    Nested 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 Type
    Method
    Description
    void
    appendRow(Object[] values)
    Add a new row given values array.
    void
    Add a new row given a Row data
    Get the array of column meta
    int
    Find the index of the target in columnMetas
    getRow(int index)
    Get Row data given index value
    remove(int columnIndex)
    Build a new DataFrame by removing one column based on index
    select(int[] columns)
    Build a new DataFrame given the input columns
    int
    Get the size of the data frame.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator

    Methods inherited from interface org.opensearch.core.xcontent.ToXContent

    toXContent

    Methods inherited from interface org.opensearch.core.xcontent.ToXContentObject

    isFragment

    Methods inherited from interface org.opensearch.core.common.io.stream.Writeable

    writeTo
  • Method Details

    • appendRow

      void appendRow(Object[] values)
      Add a new row given values array.
      Parameters:
      values - input values
    • appendRow

      void appendRow(Row row)
      Add a new row given a Row data
      Parameters:
      row - input row data
    • getRow

      Row getRow(int index)
      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

      DataFrame remove(int columnIndex)
      Build a new DataFrame by removing one column based on index
      Parameters:
      columnIndex - the index of column
      Returns:
      new DataFrame
    • select

      DataFrame select(int[] columns)
      Build a new DataFrame given the input columns
      Parameters:
      columns - the indices of column
      Returns:
      new DataFrame
    • getColumnIndex

      int getColumnIndex(String target)
      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