Skip to content

Commit 0ce1e53

Browse files
chore(types): move types and make mods private (#9554)
Signed-off-by: Runji Wang <[email protected]>
1 parent 3cff0eb commit 0ce1e53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+559
-554
lines changed

src/batch/src/executor/insert.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ use futures::future::try_join_all;
1919
use futures_async_stream::try_stream;
2020
use itertools::Itertools;
2121
use risingwave_common::array::column::Column;
22-
use risingwave_common::array::serial_array::SerialArray;
23-
use risingwave_common::array::{ArrayBuilder, DataChunk, Op, PrimitiveArrayBuilder, StreamChunk};
22+
use risingwave_common::array::{
23+
ArrayBuilder, DataChunk, Op, PrimitiveArrayBuilder, SerialArray, StreamChunk,
24+
};
2425
use risingwave_common::catalog::{Field, Schema, TableId, TableVersionId};
2526
use risingwave_common::error::{Result, RwError};
2627
use risingwave_common::types::DataType;

src/common/benches/bench_encoding.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ use std::sync::Arc;
1717

1818
use criterion::{black_box, criterion_group, criterion_main, Criterion};
1919
use risingwave_common::array::{ListValue, StructValue};
20-
use risingwave_common::types::struct_type::StructType;
21-
use risingwave_common::types::{DataType, Date, Datum, Interval, ScalarImpl, Time, Timestamp};
20+
use risingwave_common::types::{
21+
DataType, Date, Datum, Interval, ScalarImpl, StructType, Time, Timestamp,
22+
};
2223
use risingwave_common::util::sort_util::OrderType;
2324
use risingwave_common::util::{memcmp_encoding, value_encoding};
2425

src/common/src/array/arrow.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ use itertools::Itertools;
2222

2323
use super::column::Column;
2424
use super::*;
25-
use crate::types::num256::Int256;
26-
use crate::types::struct_type::StructType;
25+
use crate::types::{Int256, StructType};
2726
use crate::util::iter_util::ZipEqFast;
2827

2928
// Implement bi-directional `From` between `DataChunk` and `arrow_array::RecordBatch`.
@@ -124,7 +123,7 @@ impl From<&arrow_schema::DataType> for DataType {
124123
Binary => Self::Bytea,
125124
Utf8 => Self::Varchar,
126125
LargeUtf8 => Self::Jsonb,
127-
Struct(field) => Self::Struct(Arc::new(struct_type::StructType {
126+
Struct(field) => Self::Struct(Arc::new(StructType {
128127
fields: field.iter().map(|f| f.data_type().into()).collect(),
129128
field_names: field.iter().map(|f| f.name().clone()).collect(),
130129
})),
@@ -653,7 +652,7 @@ impl TryFrom<&arrow_array::StructArray> for StructArray {
653652
#[cfg(test)]
654653
mod tests {
655654
use super::*;
656-
use crate::types::interval::test_utils::IntervalTestExt;
655+
use crate::types::test_utils::IntervalTestExt;
657656
use crate::{array, empty_array};
658657

659658
#[test]

src/common/src/array/bool_array.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ mod tests {
179179
use itertools::Itertools;
180180

181181
use super::*;
182-
use crate::array::{read_bool_array, NULL_VAL_FOR_HASH};
182+
use crate::array::{ArrayImpl, NULL_VAL_FOR_HASH};
183183
use crate::util::iter_util::ZipEqFast;
184184

185185
fn helper_test_builder(data: Vec<Option<bool>>) -> BoolArray {
@@ -228,7 +228,9 @@ mod tests {
228228
let array = helper_test_builder(v.clone());
229229

230230
let encoded = array.to_protobuf();
231-
let decoded = read_bool_array(&encoded, num_bits).unwrap().into_bool();
231+
let decoded = ArrayImpl::from_protobuf(&encoded, num_bits)
232+
.unwrap()
233+
.into_bool();
232234

233235
let equal = array
234236
.iter()

src/common/src/array/column_proto_readers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ use crate::array::{
2525
PrimitiveArrayBuilder, PrimitiveArrayItemType, TimeArrayBuilder, TimestampArrayBuilder,
2626
};
2727
use crate::buffer::Bitmap;
28-
use crate::types::interval::Interval;
29-
use crate::types::{Date, Time, Timestamp};
28+
use crate::types::{Date, Interval, Time, Timestamp};
3029

3130
// TODO: Use techniques like apache arrow flight RPC to eliminate deserialization.
3231
// https://arrow.apache.org/docs/format/Flight.html

src/common/src/array/data_chunk.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ use crate::estimate_size::EstimateSize;
2929
use crate::field_generator::{FieldGeneratorImpl, VarcharProperty};
3030
use crate::hash::HashCode;
3131
use crate::row::Row;
32-
use crate::types::struct_type::StructType;
33-
use crate::types::to_text::ToText;
34-
use crate::types::{DataType, ToOwnedDatum};
32+
use crate::types::{DataType, StructType, ToOwnedDatum, ToText};
3533
use crate::util::hash_util::finalize_hashers;
3634
use crate::util::iter_util::{ZipEqDebug, ZipEqFast};
3735
use crate::util::value_encoding::{
@@ -42,6 +40,7 @@ use crate::util::value_encoding::{
4240
/// [`DataChunk`] is a collection of Columns,
4341
/// a with visibility mask for each row.
4442
/// For instance, we could have a [`DataChunk`] of this format.
43+
///
4544
/// | v1 | v2 | v3 |
4645
/// |----|----|----|
4746
/// | 1 | a | t |
@@ -52,6 +51,7 @@ use crate::util::value_encoding::{
5251
/// Our columns are v1, v2, v3.
5352
/// Then, if the Visibility Mask hides rows 2 and 4,
5453
/// We will only have these rows visible:
54+
///
5555
/// | v1 | v2 | v3 |
5656
/// |----|----|----|
5757
/// | 1 | a | t |

src/common/src/array/interval_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use super::{PrimitiveArray, PrimitiveArrayBuilder};
16-
use crate::types::interval::Interval;
16+
use crate::types::Interval;
1717

1818
pub type IntervalArray = PrimitiveArray<Interval>;
1919
pub type IntervalArrayBuilder = PrimitiveArrayBuilder<Interval>;
@@ -23,7 +23,7 @@ mod tests {
2323
use super::IntervalArray;
2424
use crate::array::interval_array::{Interval, IntervalArrayBuilder};
2525
use crate::array::{Array, ArrayBuilder};
26-
use crate::types::interval::test_utils::IntervalTestExt;
26+
use crate::types::test_utils::IntervalTestExt;
2727

2828
#[test]
2929
fn test_interval_array() {

0 commit comments

Comments
 (0)