pub struct Dataset { /* private fields */ }
Expand description
Lance Dataset
Implementations§
source§impl Dataset
impl Dataset
sourcepub async fn checkout(uri: &str, version: u64) -> Result<Self>
pub async fn checkout(uri: &str, version: u64) -> Result<Self>
Check out a version of the dataset.
sourcepub async fn write(
batches: &mut Box<dyn RecordBatchReader>,
uri: &str,
params: Option<WriteParams>
) -> Result<Self>
pub async fn write(
batches: &mut Box<dyn RecordBatchReader>,
uri: &str,
params: Option<WriteParams>
) -> Result<Self>
Write to or Create a Dataset with a stream of RecordBatchs.
Returns the newly created Dataset
. Returns Error if the dataset already exists.
sourcepub async fn count_rows(&self) -> Result<usize>
pub async fn count_rows(&self) -> Result<usize>
Count the number of rows in the dataset.
It offers a fast path of counting rows by just computing via metadata.
sourcepub async fn create_index(
&self,
columns: &[&str],
index_type: IndexType,
name: Option<String>,
params: &dyn IndexParams
) -> Result<Self>
pub async fn create_index(
&self,
columns: &[&str],
index_type: IndexType,
name: Option<String>,
params: &dyn IndexParams
) -> Result<Self>
Create indices on columns.
Upon finish, a new dataset version is generated.
Parameters:
columns
: the columns to build the indices on.index_type
: specifyIndexType
.name
: optional index name. Must be unique in the dataset. if not provided, it will auto-generate one.params
: index parameters.
pub fn version(&self) -> Version
pub fn schema(&self) -> &Schema
pub fn fragments(&self) -> &Arc<Vec<Fragment>>
sourcepub async fn load_indices(&self) -> Result<Vec<Index>>
pub async fn load_indices(&self) -> Result<Vec<Index>>
Read all indices of this Dataset version.