Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java/lance-jni/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn sql_builder(
let sql_str = sql.extract(env)?;
let table_str = env.get_string_opt(&table_name)?;

let mut dataset_guard =
let dataset_guard =
unsafe { env.get_rust_field::<_, _, BlockingDataset>(java_dataset, NATIVE_DATASET) }?;

let mut builder = dataset_guard
Expand Down
3 changes: 1 addition & 2 deletions python/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2567,8 +2567,7 @@ impl Dataset {

#[pyo3(signature=(sql))]
fn sql(&self, sql: String) -> PyResult<SqlQueryBuilder> {
let mut ds = self.ds.as_ref().clone();
let builder = ds.sql(&sql);
let builder = self.ds.sql(&sql);
Ok(SqlQueryBuilder { builder })
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust/lance/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ impl Dataset {
/// Run a SQL query against the dataset.
/// The underlying SQL engine is DataFusion.
/// Please refer to the DataFusion documentation for supported SQL syntax.
pub fn sql(&mut self, sql: &str) -> SqlQueryBuilder {
pub fn sql(&self, sql: &str) -> SqlQueryBuilder {
SqlQueryBuilder::new(self.clone(), sql)
}

Expand Down
8 changes: 4 additions & 4 deletions rust/lance/src/dataset/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mod tests {

#[tokio::test]
async fn test_sql_execute() {
let mut ds = gen_batch()
let ds = gen_batch()
.col("x", array::step::<Int32Type>())
.col("y", array::step_custom::<Int32Type>(0, 2))
.into_dataset(
Expand Down Expand Up @@ -167,7 +167,7 @@ mod tests {

#[tokio::test]
async fn test_sql_count() {
let mut ds = gen_batch()
let ds = gen_batch()
.col("x", array::step::<Int32Type>())
.col("y", array::step_custom::<Int32Type>(0, 2))
.into_dataset(
Expand Down Expand Up @@ -211,7 +211,7 @@ mod tests {

#[tokio::test]
async fn test_explain() {
let mut ds = gen_batch()
let ds = gen_batch()
.col("x", array::step::<Int32Type>())
.col("y", array::step_custom::<Int32Type>(0, 2))
.into_dataset(
Expand Down Expand Up @@ -248,7 +248,7 @@ mod tests {

#[tokio::test]
async fn test_analyze() {
let mut ds = gen_batch()
let ds = gen_batch()
.col("x", array::step::<Int32Type>())
.col("y", array::step_custom::<Int32Type>(0, 2))
.into_dataset(
Expand Down
Loading