Skip to content

Commit

Permalink
refine docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Jan 16, 2025
1 parent 89df9c7 commit b93af85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/frontend/src/handler/alter_table_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ pub async fn handle_alter_table_column(
if let Some(format_encode) = &format_encode
&& schema_has_schema_registry(format_encode)
{
// TODO(purify): we may support this.
Err(ErrorCode::NotSupported(
"alter table with schema registry".to_owned(),
"try `ALTER TABLE .. FORMAT .. ENCODE .. (...)` instead".to_owned(),
Expand Down
17 changes: 10 additions & 7 deletions src/frontend/src/handler/create_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,24 +651,27 @@ pub fn bind_connector_props(
}

/// When the schema can be inferred from external system (like schema registry),
/// how to handle the regular columns (i.e., non-generated) from SQL?
/// how to handle the regular columns (i.e., non-generated) defined in SQL?
pub enum SqlColumnStrategy {
/// Follow all columns from SQL, ignore the columns from external system.
/// Follow all columns defined in SQL, ignore the columns from external system.
///
/// This is the behavior when `SINK INTO` or `[ADD | DROP] COLUMN` atop the purified SQL,
/// ensuring that no accidental refresh will happen and the schema remains unchanged.
// TODO(purify): we may validate whether defined columns are valid against the resolved schema.
Follow,

/// Merge the generated columns from SQL and columns from external system. If there are
/// regular columns from SQL, ignore silently.
/// Merge the generated columns defined in SQL and columns from external system. If there
/// are also regular columns defined in SQL, ignore silently.
///
/// This is the behavior when `REFRESH SCHEMA` atop the purified SQL.
Ignore,

/// Merge the generated columns from SQL and columns from external system. If there are
/// regular columns from SQL, reject the request with an error.
/// Merge the generated columns defined in SQL and columns from external system. If there
/// are also regular columns defined in SQL, reject the request.
///
/// This is the behavior when creating a source with a purified SQL.
/// This is the behavior when creating a new table or source with a resolvable schema.
// TODO(purify): we may accept this as there are some practical use cases, see
// https://github.com/risingwavelabs/risingwave/issues/12199
Reject,
}

Expand Down

0 comments on commit b93af85

Please sign in to comment.