risingwave_frontend::handler::alter_source_with_sr

Function columns_minus

source
fn columns_minus(
    columns_a: &[ColumnCatalog],
    columns_b: &[ColumnCatalog],
) -> Vec<ColumnCatalog>
Expand description

Returns the columns in columns_a but not in columns_b.

Note:

  • The comparison is done by name and data type, without checking ColumnId.
  • Hidden columns and INCLUDE ... AS ... columns are ignored. Because it’s only for the special handling of alter sr. For the newly resolved columns_from_resolve_source (created by bind_columns_from_source), it doesn’t contain hidden columns (_row_id) and INCLUDE ... AS ... columns. This is fragile and we should really refactor it later.