Class ColumnDefinitionVector

java.lang.Object
com.datastax.astra.client.tables.definition.columns.ColumnDefinition
com.datastax.astra.client.tables.definition.columns.ColumnDefinitionVector

public class ColumnDefinitionVector extends ColumnDefinition
Represents a column definition for vector-based data. Extends ColumnDefinition to include properties and methods specific to vector data such as dimension, similarity metric, and vectorization service.

This class facilitates the configuration of vector columns in a data schema.

Example usage:

 
 ColumnDefinitionVector vectorColumn = new ColumnDefinitionVector()
      .dimension(128)
      .metric(SimilarityMetric.COSINE);
 
 
  • Constructor Details

    • ColumnDefinitionVector

      public ColumnDefinitionVector()
      Constructs a new ColumnDefinitionVector instance with the column type set to ColumnTypes.VECTOR.
  • Method Details

    • dimension

      public ColumnDefinitionVector dimension(int dimension)
      Sets the dimension of the vector and returns the updated instance.
      Parameters:
      dimension - the dimension of the vector
      Returns:
      this ColumnDefinitionVector instance
    • metric

      Sets the similarity metric for vector comparison and returns the updated instance.
      Parameters:
      m - the similarity metric
      Returns:
      this ColumnDefinitionVector instance
    • service

      public ColumnDefinitionVector service(VectorServiceOptions service)
      Sets the vectorization service options and returns the updated instance.
      Parameters:
      service - the vectorization service options
      Returns:
      this ColumnDefinitionVector instance