1use std::sync::Arc;
16
17use common_error::ext::BoxedError;
18use common_recordbatch::SendableRecordBatchStream;
19use store_api::data_source::DataSource;
20use store_api::storage::ScanRequest;
21
22use crate::error::UnsupportedSnafu;
23use crate::metadata::{FilterPushDownType, TableInfoRef};
24use crate::{Table, TableRef};
25
26#[derive(Clone)]
27pub struct DistTable;
28
29impl DistTable {
30 pub fn table(table_info: TableInfoRef) -> TableRef {
31 let data_source = Arc::new(DummyDataSource);
32 let table = Table::new(table_info, FilterPushDownType::Inexact, data_source);
33 Arc::new(table)
34 }
35}
36
37pub struct DummyDataSource;
38
39impl DataSource for DummyDataSource {
40 fn get_stream(
41 &self,
42 _request: ScanRequest,
43 ) -> std::result::Result<SendableRecordBatchStream, BoxedError> {
44 UnsupportedSnafu {
45 operation: "get stream from a distributed table",
46 }
47 .fail()
48 .map_err(BoxedError::new)
49 }
50}