From b0bc75722be973815d1a9244bf2d4af286077071 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Wed, 18 Dec 2024 14:29:53 +0800 Subject: [PATCH] add docs for alter sourrrrrrrrrrrrrrrrrrrrrrrrrrce Signed-off-by: Bugen Zhao --- src/frontend/src/handler/alter_source_with_sr.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/src/handler/alter_source_with_sr.rs b/src/frontend/src/handler/alter_source_with_sr.rs index 196d4a7eaf39..bcc83959d096 100644 --- a/src/frontend/src/handler/alter_source_with_sr.rs +++ b/src/frontend/src/handler/alter_source_with_sr.rs @@ -81,6 +81,9 @@ fn encode_type_to_encode(from: EncodeType) -> Option { /// - 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. +/// - Column with the same name but different data type is considered as a different column, i.e., altering the data type of a column +/// will be treated as dropping the old column and adding a new column. Note that we don't reject here like we do in `ALTER TABLE REFRESH SCHEMA`, +/// because there's no data persistence (thus compatibility concern) in the source case. fn columns_minus(columns_a: &[ColumnCatalog], columns_b: &[ColumnCatalog]) -> Vec { columns_a .iter()