Skip to content

Commit

Permalink
fix: projection miss _null and _ts
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould authored and ethe committed Jul 24, 2024
1 parent 6ffc4e9 commit da2d1aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ where
for p in &mut projection {
*p += 2;
}

projection.extend([0, 1, 2]);
let mask = ProjectionMask::roots(
&arrow_to_parquet_schema(R::arrow_schema()).unwrap(),
projection,
Expand Down
13 changes: 12 additions & 1 deletion src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ where
let streams = vec![TransactionScan {
inner: self.local.range(range),
ts: self.ts,
}.into()];
}
.into()];
Scan::new(&self.share, range, self.ts, &self.version, streams)
}

Expand Down Expand Up @@ -312,28 +313,38 @@ mod tests {
let mut stream = txn
.scan((Bound::Unbounded, Bound::Unbounded))
.await
.projection(vec![1])
.take()
.await
.unwrap();

let entry_0 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_0.key().value, "1");
assert!(entry_0.value().vbool.is_none());
let entry_1 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_1.key().value, "2");
assert!(entry_1.value().vbool.is_none());
let entry_2 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_2.key().value, "3");
assert!(entry_2.value().vbool.is_none());
let entry_3 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_3.key().value, "4");
assert!(entry_3.value().vbool.is_none());
let entry_4 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_4.key().value, "5");
assert!(entry_4.value().vbool.is_none());
let entry_5 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_5.key().value, "6");
assert!(entry_5.value().vbool.is_none());
let entry_6 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_6.key().value, "7");
assert!(entry_6.value().vbool.is_none());
let entry_7 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_7.key().value, "8");
assert!(entry_7.value().vbool.is_none());
let entry_8 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_8.key().value, "9");
assert!(entry_8.value().vbool.is_none());
let entry_9 = stream.next().await.unwrap().unwrap();
assert_eq!(entry_9.key().value, "alice");
let entry_10 = stream.next().await.unwrap().unwrap();
Expand Down

0 comments on commit da2d1aa

Please sign in to comment.