Skip to content

Commit 17421b4

Browse files
authored
feat: add public accessors for lance scan fields (#3739)
This adds public accessors for the dataset, fragments, range, and projection fields of a LanceScanExec node, to better enable processing of LanceScanExec nodes in optimizer rules.
1 parent 9f62bce commit 17421b4

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

rust/lance/src/io/exec/scan.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,26 @@ impl LanceScanExec {
550550
metrics: ExecutionPlanMetricsSet::new(),
551551
}
552552
}
553+
554+
/// Get the dataset for this scan.
555+
pub fn dataset(&self) -> &Arc<Dataset> {
556+
&self.dataset
557+
}
558+
559+
/// Get the fragments for this scan.
560+
pub fn fragments(&self) -> &Arc<Vec<Fragment>> {
561+
&self.fragments
562+
}
563+
564+
/// Get the range for this scan.
565+
pub fn range(&self) -> &Option<Range<u64>> {
566+
&self.range
567+
}
568+
569+
/// Get the projection for this scan.
570+
pub fn projection(&self) -> &Arc<Schema> {
571+
&self.projection
572+
}
553573
}
554574

555575
impl ExecutionPlan for LanceScanExec {

rust/lance/src/io/exec/take.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,6 @@ impl TakeExec {
439439
}
440440

441441
/// Get the dataset.
442-
///
443-
/// WARNING: Internal API with no stability guarantees.
444442
pub fn dataset(&self) -> &Arc<Dataset> {
445443
&self.dataset
446444
}

0 commit comments

Comments
 (0)