Skip to content

Conversation

@leiyuou
Copy link
Contributor

@leiyuou leiyuou commented Dec 15, 2025

Support MIN and MAX in the datafusion planner

Add unit test and integration test

Add a helper function to add one more people in dataset.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 90.62500% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...t/lance-graph/src/datafusion_planner/expression.rs 90.62% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

use lance_graph::{CypherQuery, ExecutionStrategy};
use std::collections::HashMap;
use std::sync::Arc;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you keep this blank line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

.unwrap()
}

fn add_new_person_to_dataset(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reviewing the tests you added for MIN and MAX, I don't think this method is necessary: it is just used to add a new person to the dataset, but the current person dataset has already had 5 rows (so good enough to find max/min age). Could you remove this helper function and update the tests accordingly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, I thought we should add an extra item that shares the same city value as one of the existing five items. However, after checking the documentation, I realized that RecordBatch is immutable. Adding a new value would therefore require creating a new RecordBatch, which is inefficient. I agree that we should remove this method. Updated.

@@ -1,10 +1,10 @@
use arrow::compute::kernels::numeric::add;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is unused in this test file: could you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

}

#[tokio::test]
async fn test_max_without_alias_has_descriptive_name() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, MIN and MAX are sharing very similar features, so I think we don't need this many new tests. How about just keeping

  • test_min_property
  • test_max_property
  • test_min_max_with_grouping (testing min and max with grouping in one method)

We can safely remove other MIN/MAX tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@ChunxuTang
Copy link
Collaborator

@leiyuou Thanks for the work! Just left some minor comments (mainly about integration test organization).

Copy link
Collaborator

@ChunxuTang ChunxuTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks for the work!

@ChunxuTang ChunxuTang merged commit 6f74e51 into lance-format:main Dec 16, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants