Class SparseDoubleVector

java.lang.Object
io.debezium.data.vector.SparseDoubleVector

public class SparseDoubleVector extends Object
A semantic type to represent a double-precision sparse vector. The vector data type commonly consists of a collection of values in which each index of the underlying vector has a value; however, this can be memory intensive and wasteful when only a subset of indices is populated. In such cases, a "sparse vector" can be used, defining a map of key/value pairs for only the indices that are populated. An example is PostgreSQL's sparsevec data type.
Author:
Mincong Huang
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static int
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.kafka.connect.data.SchemaBuilder
    Returns a SchemaBuilder for a float64 sparse vector field.
    static org.apache.kafka.connect.data.Struct
    fromLogical(org.apache.kafka.connect.data.Schema schema, String value)
    Converts a value from its logical format - String of {i1: v1, i2: v2, ...}/dimensions to its encoded format - a Struct with a number of dimensions and a map of index to value
    static org.apache.kafka.connect.data.Schema
    Returns a SchemaBuilder for a float64 sparse vector field, with all other default Schema settings.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SparseDoubleVector

      public SparseDoubleVector()
  • Method Details

    • builder

      public static org.apache.kafka.connect.data.SchemaBuilder builder()
      Returns a SchemaBuilder for a float64 sparse vector field. You can use the resulting SchemaBuilder to set additional schema settings such as required/optional, default value, and documentation.
      Returns:
      the schema builder
    • schema

      public static org.apache.kafka.connect.data.Schema schema()
      Returns a SchemaBuilder for a float64 sparse vector field, with all other default Schema settings.
      Returns:
      the schema
      See Also:
    • fromLogical

      public static org.apache.kafka.connect.data.Struct fromLogical(org.apache.kafka.connect.data.Schema schema, String value)
      Converts a value from its logical format - String of {i1: v1, i2: v2, ...}/dimensions to its encoded format - a Struct with a number of dimensions and a map of index to value
      Parameters:
      schema - of the encoded value
      value - the value of the vector
      Returns:
      the encoded value