remove_column Action

Implement the remove_column DoAction to support ALTER TABLE DROP COLUMN statements for removing columns from tables.

The remove_column action removes a column from an existing table. This action is invoked when executing an ALTER TABLE ... DROP COLUMN SQL statement.

SQL Example

ALTER TABLE example.main.employees DROP COLUMN middle_name;
ALTER TABLE example.main.employees DROP COLUMN IF EXISTS department CASCADE;

Input Parameters

The action receives a single msgpack-serialized parameter:

// The base class for all alter parameters.
struct AirportAlterBase
{
  //! Catalog name to alter
  std::string catalog;
  //! Schema name to alter
  std::string schema;
  //! Entry name to alter
  std::string name;
  bool ignore_not_found;
};

struct AirportRemoveTableColumnParameters : AirportAlterBase
{
  std::string removed_column;
  bool if_column_exists;
  bool cascade;

  MSGPACK_DEFINE_MAP(catalog, schema, name, ignore_not_found, removed_column, if_column_exists, cascade);
};

Return Value

The action must return a single FlightInfo structure representing the modified table with the column removed from its schema. The app_metadata field must be populated appropriately to identify the flight as a table.