Class XContentRowEncoder

java.lang.Object
org.elasticsearch.xpack.esql.inference.XContentRowEncoder
All Implemented Interfaces:
Closeable, AutoCloseable, EvalOperator.ExpressionEvaluator, org.elasticsearch.core.Releasable

public class XContentRowEncoder extends Object implements EvalOperator.ExpressionEvaluator
Encodes rows into an XContent format (JSON,YAML,...) for further processing. Extracted columns can be specified using EvalOperator.ExpressionEvaluator
  • Method Details

    • yamlRowEncoderFactory

      public static XContentRowEncoder.Factory yamlRowEncoderFactory(Map<ColumnInfoImpl,EvalOperator.ExpressionEvaluator.Factory> fieldsEvaluatorFactories)
      Creates a factory for YAML XContent row encoding.
      Parameters:
      fieldsEvaluatorFactories - A map of column information to expression evaluators.
      Returns:
      A Factory instance for creating YAML row encoder for the specified column.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • eval

      public BytesRefBlock eval(Page page)
      Process the provided Page and encode its rows into a BytesRefBlock containing XContent-formatted rows.
      Specified by:
      eval in interface EvalOperator.ExpressionEvaluator
      Parameters:
      page - The input Page containing row data.
      Returns:
      A BytesRefBlock containing the encoded rows.
    • fieldNames

      public List<String> fieldNames()
    • toString

      public String toString()
      Overrides:
      toString in class Object