Skip to main content

Class AlterTableColumnsRequest

java.lang.Object
com.gpudb.protocol.AlterTableColumnsRequest
All Implemented Interfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

public class AlterTableColumnsRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters for GPUdb.alterTableColumns.

Apply various modifications to columns in a table, view. The available modifications include the following:

Create or delete an index on a particular column. This can speed up certain operations when using expressions containing equality or relational operators on indexed columns. This only applies to tables.

Manage a table’s columns—a column can be added, removed, or have its type and properties modified, including whether it is dictionary encoded or not.

  • Constructor Details

    • AlterTableColumnsRequest

      public AlterTableColumnsRequest()
      Constructs an AlterTableColumnsRequest object with default parameters.
    • AlterTableColumnsRequest

      public AlterTableColumnsRequest(String tableName, List<Map<String,String>> columnAlterations, Map<String,String> options)
      Constructs an AlterTableColumnsRequest object with the specified parameters.
      Parameters:
      tableName - Table on which the operation will be performed. Must be an existing table or view, in [schema_name.]table_name format, using standard name resolution rules.
      columnAlterations - List of alter table add/delete/change column requests - all for the same table. Each request is a map that includes ‘column_name’, ‘action’ and the options specific for the action. Note that the same options as in alter table requests but in the same map as the column name and the action. For example: [‘column_name’:‘col_1’,‘action’:‘change_column’,‘rename_column’:‘col_2’,‘column_name’:‘col_1’,‘action’:‘add_column’, ‘type’:‘int’,‘default_value’:‘1’].
      options - Optional parameters.
  • Method Details

    • getClassSchema

      public static org.apache.avro.Schema getClassSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Returns:
      The schema for the class.
    • getTableName

      public String getTableName()
      Table on which the operation will be performed. Must be an existing table or view, in [schema_name.]table_name format, using standard name resolution rules.
      Returns:
      The current value of tableName.
    • setTableName

      public AlterTableColumnsRequest setTableName(String tableName)
      Table on which the operation will be performed. Must be an existing table or view, in [schema_name.]table_name format, using standard name resolution rules.
      Parameters:
      tableName - The new value for tableName.
      Returns:
      this to mimic the builder pattern.
    • getColumnAlterations

      public List<Map<String,String>> getColumnAlterations()
      List of alter table add/delete/change column requests - all for the same table. Each request is a map that includes ‘column_name’, ‘action’ and the options specific for the action. Note that the same options as in alter table requests but in the same map as the column name and the action. For example: [‘column_name’:‘col_1’,‘action’:‘change_column’,‘rename_column’:‘col_2’,‘column_name’:‘col_1’,‘action’:‘add_column’, ‘type’:‘int’,‘default_value’:‘1’].
      Returns:
      The current value of columnAlterations.
    • setColumnAlterations

      public AlterTableColumnsRequest setColumnAlterations(List<Map<String,String>> columnAlterations)
      List of alter table add/delete/change column requests - all for the same table. Each request is a map that includes ‘column_name’, ‘action’ and the options specific for the action. Note that the same options as in alter table requests but in the same map as the column name and the action. For example: [‘column_name’:‘col_1’,‘action’:‘change_column’,‘rename_column’:‘col_2’,‘column_name’:‘col_1’,‘action’:‘add_column’, ‘type’:‘int’,‘default_value’:‘1’].
      Parameters:
      columnAlterations - The new value for columnAlterations.
      Returns:
      this to mimic the builder pattern.
    • getOptions

      public Map<String,String> getOptions()
      Optional parameters.
      Returns:
      The current value of options.
    • setOptions

      public AlterTableColumnsRequest setOptions(Map<String,String> options)
      Optional parameters.
      Parameters:
      options - The new value for options.
      Returns:
      this to mimic the builder pattern.
    • getSchema

      public org.apache.avro.Schema getSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      getSchema in interface org.apache.avro.generic.GenericContainer
      Returns:
      The schema object describing this class.
    • get

      public Object get(int index)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to get
      Returns:
      value of the field with the given index.
      Throws:
    • put

      public void put(int index, Object value)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to set
      value - the value to set
      Throws:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object