Skip to content

Commit

Permalink
not pass format encode because it has been in the table definition
Browse files Browse the repository at this point in the history
  • Loading branch information
st1page committed Nov 5, 2024
1 parent 322cbf0 commit 47a190f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
18 changes: 8 additions & 10 deletions src/frontend/src/handler/alter_table_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ pub async fn get_replace_table_plan(
table_name: ObjectName,
new_definition: Statement,
old_catalog: &Arc<TableCatalog>,
format_encode: Option<FormatEncodeOptions>,
new_version_columns: Option<Vec<ColumnCatalog>>, // only provided in auto schema change
) -> Result<(
Option<Source>,
Expand All @@ -161,12 +160,17 @@ pub async fn get_replace_table_plan(
with_version_column,
wildcard_idx,
cdc_table_info,
format_encode,
..
} = new_definition
else {
panic!("unexpected statement type: {:?}", new_definition);
};

let format_encode = format_encode
.clone()
.map(|format_encode| format_encode.into_v2_with_warning());

let (mut graph, table, source, job_type) = generate_stream_graph_for_replace_table(
session,
table_name,
Expand Down Expand Up @@ -307,6 +311,7 @@ pub async fn handle_alter_table_column(
else {
panic!("unexpected statement: {:?}", definition);
};

let format_encode = format_encode
.clone()
.map(|format_encode| format_encode.into_v2_with_warning());
Expand Down Expand Up @@ -430,15 +435,8 @@ pub async fn handle_alter_table_column(
_ => unreachable!(),
};

let (source, table, graph, col_index_mapping, job_type) = get_replace_table_plan(
&session,
table_name,
definition,
&original_catalog,
format_encode,
None,
)
.await?;
let (source, table, graph, col_index_mapping, job_type) =
get_replace_table_plan(&session, table_name, definition, &original_catalog, None).await?;

let catalog_writer = session.catalog_writer()?;

Expand Down
12 changes: 3 additions & 9 deletions src/frontend/src/handler/alter_table_with_sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub async fn handle_refresh_schema(
format_encode.unwrap()
};

// NOTE(st1page): since we have not implemented alter format encode for table, it is actually no use.
let definition = alter_definition_format_encode(
&original_table.definition,
format_encode.row_options.clone(),
Expand All @@ -75,15 +76,8 @@ pub async fn handle_refresh_schema(
.unwrap();

let (source, table, graph, col_index_mapping, job_type) = {
let result = get_replace_table_plan(
&session,
table_name,
definition,
&original_table,
Some(format_encode),
None,
)
.await;
let result =
get_replace_table_plan(&session, table_name, definition, &original_table, None).await;
match result {
Ok((source, table, graph, col_index_mapping, job_type)) => {
Ok((source, table, graph, col_index_mapping, job_type))
Expand Down
1 change: 0 additions & 1 deletion src/frontend/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ async fn get_new_table_plan(
table_name,
new_table_definition,
&original_catalog,
None,
Some(new_version_columns),
)
.await?;
Expand Down

0 comments on commit 47a190f

Please sign in to comment.