Skip to content

Commit

Permalink
update expect strings
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Chien <[email protected]>
  • Loading branch information
stdrc committed Apr 5, 2024
1 parent 94a4f3e commit 138b1a7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
15 changes: 10 additions & 5 deletions src/common/fields-derive/src/gen/test_empty_pk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ impl ::risingwave_common::types::Fields for Data {
const PRIMARY_KEY: Option<&'static [usize]> = Some(&[]);
fn fields() -> Vec<(&'static str, ::risingwave_common::types::DataType)> {
vec![
("v1", < i16 as ::risingwave_common::types::WithDataType >
::default_data_type()), ("v2", < String as
::risingwave_common::types::WithDataType > ::default_data_type())
(
"v1",
<i16 as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"v2",
<String as ::risingwave_common::types::WithDataType>::default_data_type(),
),
]
}
fn into_owned_row(self) -> ::risingwave_common::row::OwnedRow {
::risingwave_common::row::OwnedRow::new(
vec![
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v1),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v2)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v2),
],
)
}
Expand All @@ -21,7 +26,7 @@ impl From<Data> for ::risingwave_common::types::ScalarImpl {
::risingwave_common::types::StructValue::new(
vec![
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v1),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v2)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v2),
],
)
.into()
Expand Down
15 changes: 10 additions & 5 deletions src/common/fields-derive/src/gen/test_no_pk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@ impl ::risingwave_common::types::Fields for Data {
const PRIMARY_KEY: Option<&'static [usize]> = None;
fn fields() -> Vec<(&'static str, ::risingwave_common::types::DataType)> {
vec![
("v1", < i16 as ::risingwave_common::types::WithDataType >
::default_data_type()), ("v2", < String as
::risingwave_common::types::WithDataType > ::default_data_type())
(
"v1",
<i16 as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"v2",
<String as ::risingwave_common::types::WithDataType>::default_data_type(),
),
]
}
fn into_owned_row(self) -> ::risingwave_common::row::OwnedRow {
::risingwave_common::row::OwnedRow::new(
vec![
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v1),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v2)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v2),
],
)
}
Expand All @@ -21,7 +26,7 @@ impl From<Data> for ::risingwave_common::types::ScalarImpl {
::risingwave_common::types::StructValue::new(
vec![
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v1),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v2)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v2),
],
)
.into()
Expand Down
31 changes: 22 additions & 9 deletions src/common/fields-derive/src/gen/test_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@ impl ::risingwave_common::types::Fields for Data {
const PRIMARY_KEY: Option<&'static [usize]> = Some(&[1usize, 0usize]);
fn fields() -> Vec<(&'static str, ::risingwave_common::types::DataType)> {
vec![
("v1", < i16 as ::risingwave_common::types::WithDataType >
::default_data_type()), ("v2", < std::primitive::i32 as
::risingwave_common::types::WithDataType > ::default_data_type()), ("v3", <
bool as ::risingwave_common::types::WithDataType > ::default_data_type()),
("v4", < Serial as ::risingwave_common::types::WithDataType >
::default_data_type()), ("type", < i32 as
::risingwave_common::types::WithDataType > ::default_data_type())
(
"v1",
<i16 as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"v2",
<std::primitive::i32 as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"v3",
<bool as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"v4",
<Serial as ::risingwave_common::types::WithDataType>::default_data_type(),
),
(
"type",
<i32 as ::risingwave_common::types::WithDataType>::default_data_type(),
),
]
}
fn into_owned_row(self) -> ::risingwave_common::row::OwnedRow {
Expand All @@ -18,7 +31,7 @@ impl ::risingwave_common::types::Fields for Data {
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v2),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v3),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.v4),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.r#type)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(self.r#type),
],
)
}
Expand All @@ -31,7 +44,7 @@ impl From<Data> for ::risingwave_common::types::ScalarImpl {
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v2),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v3),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.v4),
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.r#type)
::risingwave_common::types::ToOwnedDatum::to_owned_datum(v.r#type),
],
)
.into()
Expand Down

0 comments on commit 138b1a7

Please sign in to comment.