Skip to content

Commit

Permalink
add todos to all usages to replace
Browse files Browse the repository at this point in the history
  • Loading branch information
BugenZhao committed Jan 13, 2025
1 parent df8fbed commit d9fbf84
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async fn read_relation_info(reader: &SysCatalogReaderImpl) -> Result<Vec<RwRelat
schemaname: schema.clone(),
relationname: t.name.clone(),
relationowner: t.owner as i32,
definition: t.definition.clone(),
definition: t.create_sql(),
relationtype: "MATERIALIZED VIEW".into(),
relationid: t.id.table_id as i32,
relationtimezone: fragments.get_ctx().unwrap().get_timezone().clone(),
Expand All @@ -106,7 +106,7 @@ async fn read_relation_info(reader: &SysCatalogReaderImpl) -> Result<Vec<RwRelat
schemaname: schema.clone(),
relationname: t.name.clone(),
relationowner: t.owner as i32,
definition: t.definition.clone(),
definition: t.create_sql_purified(),
relationtype: "TABLE".into(),
relationid: t.id.table_id as i32,
relationtimezone: fragments.get_ctx().unwrap().get_timezone().clone(),
Expand Down Expand Up @@ -144,7 +144,7 @@ async fn read_relation_info(reader: &SysCatalogReaderImpl) -> Result<Vec<RwRelat
schemaname: schema.clone(),
relationname: t.name.clone(),
relationowner: t.index_table.owner as i32,
definition: t.index_table.definition.clone(),
definition: t.index_table.create_sql(),
relationtype: "INDEX".into(),
relationid: t.index_table.id.table_id as i32,
relationtimezone: fragments.get_ctx().unwrap().get_timezone().clone(),
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/handler/alter_table_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub async fn get_new_table_definition_for_cdc_table(
);

// Retrieve the original table definition.
// TODO(purify): use purified definition.
let mut definition = original_catalog.create_sql_ast()?;

// Clear the original columns field, so that we'll follow `new_columns` to generate a
Expand Down Expand Up @@ -257,6 +258,7 @@ pub async fn handle_alter_table_column(
}

// Retrieve the original table definition and parse it to AST.
// TODO(purify): use purified definition.
let mut definition = original_catalog.create_sql_ast()?;
let Statement::CreateTable {
columns,
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/handler/alter_table_with_sr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use crate::error::{ErrorCode, Result};
use crate::TableCatalog;

fn get_format_encode_from_table(table: &TableCatalog) -> Result<Option<FormatEncodeOptions>> {
// TODO(purify): use purified definition.
let stmt = table.create_sql_ast()?;
let Statement::CreateTable { format_encode, .. } = stmt else {
unreachable!()
Expand Down Expand Up @@ -63,6 +64,7 @@ pub async fn handle_refresh_schema(
};

// NOTE(st1page): since we have not implemented alter format encode for table, it is actually no use.
// TODO(purify): use purified definition.
let definition = alter_definition_format_encode(
&original_table.definition,
format_encode.row_options.clone(),
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/handler/create_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ pub(crate) async fn reparse_table_for_sink(
table_catalog: &Arc<TableCatalog>,
) -> Result<(StreamFragmentGraph, Table, Option<PbSource>)> {
// Retrieve the original table definition and parse it to AST.
// TODO(purify): use purified definition.
let definition = table_catalog.create_sql_ast()?;
let Statement::CreateTable {
name,
Expand Down

0 comments on commit d9fbf84

Please sign in to comment.