drop_not_null Action

Implement the drop_not_null DoAction to support ALTER TABLE ALTER COLUMN DROP NOT NULL statements for removing column constraints.

The drop_not_null action removes a NOT NULL constraint from a column, allowing it to accept null values. This action is invoked when executing an ALTER TABLE ... ALTER COLUMN ... DROP NOT NULL SQL statement.

SQL Example

ALTER TABLE example.main.employees ALTER COLUMN middle_name DROP NOT NULL;

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 AirportAlterTableDropNotNullParameters : AirportAlterBase
{
  std::string column_name;

  MSGPACK_DEFINE_MAP(catalog, schema, name, column_name);
};

Return Value

The action must return a single FlightInfo structure representing the modified table with the NOT NULL constraint removed. The app_metadata field must be populated appropriately to identify the flight as a table.