Class AlterTableAddVectorize

java.lang.Object
com.datastax.astra.client.tables.commands.AlterTableAddVectorize
All Implemented Interfaces:
AlterTableOperation

public class AlterTableAddVectorize extends Object implements AlterTableOperation
Represents an operation to add vectorized columns to a table in a database schema alteration. Implements the AlterTableOperation interface to specify the "addVectorize" operation.

This class allows adding columns with vectorization options and supports an optional "IF NOT EXISTS" clause.

Example usage:

 
 AlterTableAddVectorize addVectorize = new AlterTableAddVectorize()
      .ifNotExists()
      .addColumn("vectorColumn", new VectorServiceOptions());
 
 
  • Constructor Details

    • AlterTableAddVectorize

      public AlterTableAddVectorize()
      Default constructor.
  • Method Details

    • getOperationName

      public String getOperationName()
      Returns the name of this operation, which is "addVectorize".
      Specified by:
      getOperationName in interface AlterTableOperation
      Returns:
      the operation name
    • addColumn

      public AlterTableAddVectorize addColumn(String name, VectorServiceOptions def)
      Adds a new column with the specified name and vectorization options.
      Parameters:
      name - the name of the column to add
      def - the vectorization options for the column
      Returns:
      this AlterTableAddVectorize instance
    • columns

      Replaces the current column definitions with the specified map of column names and vectorization options.
      Parameters:
      columns - a map of column names to their vectorization options
      Returns:
      this AlterTableAddVectorize instance