Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdc): fix wrong default column matching #20348

Merged
merged 7 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
throw error when not found
KeXiangWang committed Jan 31, 2025
commit 2222e9919d401ffb3ea9b190bdaaac72b0988264
11 changes: 7 additions & 4 deletions src/frontend/src/handler/create_table.rs
Original file line number Diff line number Diff line change
@@ -1196,10 +1196,13 @@ pub(super) async fn handle_create_table_plan(
.collect();

for col in &mut columns {
if let Some(external_col) = external_columns.get(col.name()) {
col.column_desc.generated_or_default_column =
external_col.column_desc.generated_or_default_column.clone();
}
let external_col = external_columns.get(col.name()).ok_or_else(|| {
ErrorCode::ConnectorError(
format!("Column {} not found in external table", col.name()).into(),
)
})?;
col.column_desc.generated_or_default_column =
external_col.column_desc.generated_or_default_column.clone();
}
(columns, pk_names)
}