Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
xx01cyx committed Jun 17, 2022
1 parent e839623 commit 1374eb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/src/handler/create_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub(crate) fn gen_create_table_plan(
Ok((plan, source, table))
}

/// Generate a stream plan with `StreamSource` + `StreamMaterialize`, it ressembles a
/// Generate a stream plan with `StreamSource` + `StreamMaterialize`, it resembles a
/// `CREATE MATERIALIZED VIEW AS SELECT * FROM <source>`.
pub(crate) fn gen_materialized_source_plan(
context: OptimizerContextRef,
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use risingwave_pb::catalog::table::OptionalAssociatedSourceId;
use risingwave_pb::catalog::{
Database as ProstDatabase, Schema as ProstSchema, Source as ProstSource, Table as ProstTable,
};
use risingwave_pb::common::ParallelUnitMapping;
use risingwave_pb::stream_plan::StreamFragmentGraph;
use risingwave_pb::user::{GrantPrivilege, UserInfo};
use risingwave_rpc_client::error::Result as RpcResult;
Expand Down Expand Up @@ -163,6 +164,11 @@ impl CatalogWriter for MockCatalogWriter {
_graph: StreamFragmentGraph,
) -> Result<()> {
table.id = self.gen_id();
table.mapping = Some(ParallelUnitMapping {
table_id: table.id,
original_indices: [0, 10, 20].to_vec(),
data: [1, 2, 3].to_vec(),
});
self.catalog.write().create_table(&table);
self.add_table_or_source_id(table.id, table.schema_id, table.database_id);
Ok(())
Expand Down

0 comments on commit 1374eb8

Please sign in to comment.