Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
fixci
  • Loading branch information
xxhZs committed Dec 5, 2024
1 parent 8f1d4f0 commit 8ae90aa
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/batch/src/executor/row_seq_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ impl From<&AsOf> for PbAsOf {

impl ScanRange {
/// Create a scan range from the prost representation.
pub fn new(
scan_range: PbScanRange,
mut pk_types: impl Iterator<Item = DataType>,
) -> Result<Self> {
pub fn new(scan_range: PbScanRange, mut pk_types: Vec<DataType>) -> Result<Self> {
let mut index = 0;
let pk_prefix = OwnedRow::new(
scan_range
.eq_conds
.iter()
.map(|v| {
let ty = pk_types.next().unwrap();
let ty = pk_types.get(index).unwrap();
index += 1;
deserialize_datum(v.as_slice(), &ty)
})
.try_collect()?,
Expand All @@ -122,13 +121,14 @@ impl ScanRange {
});
}

let mut build_bound = |bound: &scan_range::Bound| -> Result<Bound<OwnedRow>> {
let build_bound = |bound: &scan_range::Bound, mut index| -> Result<Bound<OwnedRow>> {
let next_col_bounds = OwnedRow::new(
bound
.value
.iter()
.map(|v| {
let ty = pk_types.next().unwrap();
let ty = pk_types.get(index).unwrap();
index += 1;
deserialize_datum(v.as_slice(), &ty)
})
.try_collect()?,
Expand All @@ -144,9 +144,9 @@ impl ScanRange {
scan_range.lower_bound.as_ref(),
scan_range.upper_bound.as_ref(),
) {
(Some(lb), Some(ub)) => (build_bound(lb)?, build_bound(ub)?),
(None, Some(ub)) => (Bound::Unbounded, build_bound(ub)?),
(Some(lb), None) => (build_bound(lb)?, Bound::Unbounded),
(Some(lb), Some(ub)) => (build_bound(lb, index)?, build_bound(ub, index)?),
(None, Some(ub)) => (Bound::Unbounded, build_bound(ub, index)?),
(Some(lb), None) => (build_bound(lb, index)?, Bound::Unbounded),
(None, None) => unreachable!(),
};
Ok(Self {
Expand Down Expand Up @@ -229,14 +229,18 @@ impl BoxedExecutorBuilder for RowSeqScanExecutorBuilder {
scan_ranges
.iter()
.map(|scan_range| {
let pk_types = table_desc.pk.iter().map(|order| {
DataType::from(
table_desc.columns[order.column_index as usize]
.column_type
.as_ref()
.unwrap(),
)
});
let pk_types = table_desc
.pk
.iter()
.map(|order| {
DataType::from(
table_desc.columns[order.column_index as usize]
.column_type
.as_ref()
.unwrap(),
)
})
.collect_vec();
ScanRange::new(scan_range.clone(), pk_types)
})
.try_collect()?
Expand Down

0 comments on commit 8ae90aa

Please sign in to comment.