这是indexloc提供的服务,不要输入任何密码
Skip to content

update for ndc-spec v0.2 #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Jan 22, 2025

Conversation

hallettj
Copy link
Collaborator

@hallettj hallettj commented Jan 10, 2025

Updates the MongoDB connector for ndc-spec v0.2 (changelog link)

The connector processes requests in two phases:

  1. ndc-query-plan converts to an internal set of request types. In that process it denormalies the request, annotates it with types, and constructs join plans.
  2. mongodb-agent-common consumes those internal types to produce mongodb query plans

This PR requires updates to both phases, including changes to the internal request types.

PR Progress

  • it compiles
  • unit tests pass
  • integration tests pass
  • changelog is updated

A number of unit tests still need to be updated according to the new mechanisms for handling relationships. But we have integration tests for relationships which are passing which seems to indicate that things are generally working.

@hallettj hallettj self-assigned this Jan 10, 2025
@hallettj hallettj marked this pull request as ready for review January 13, 2025 20:34
@@ -67,7 +76,7 @@ impl<'a> ColumnRef<'a> {
.into_iter()
.map(|field_name| field_name.as_ref() as &str),
)
.unwrap()
.expect("field_path is not empty")

Choose a reason for hiding this comment

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

Expect is better than unwrap, but perhaps handling this possible runtime error would be better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I pushed a change to make the input to this function a NonEmpty list so we get a guarantee that there won't be a panic.

@@ -87,6 +86,7 @@ pub fn make_nested_schema() -> MongoConfiguration {
}

/// Configuration for a MongoDB database with Chinook test data
#[allow(dead_code)]

Choose a reason for hiding this comment

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

why is this dead now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a test fixture that is used on some tests that I have disabled until I can rewrite them using named scopes

@hallettj hallettj requested a review from BenoitRanque January 21, 2025 23:13
@@ -462,7 +462,7 @@ mod tests {
Some(TypeConstraint::ElementOf(Box::new(
TypeConstraint::FieldOf {
target_type: Box::new(TypeConstraint::Variable(input_doc_variable)),
path: nonempty!["words".into()],
path: NonEmpty::singleton("words".into()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I had to change a bunch of lines from nonempty![x] to NonEmpty::singleton(x) because nonempty v0.11.0 has a bug in its nonempty! macro when applied to a single value. In the places we've been using it we've been using v0.10.0; I could have downgraded back to that version, but v0.11.0 has an .as_ref() method that was useful for these changes.I could have used v0.11.0 in the mongo-agent-common and ndc-query-plan crates, and left the others on v0.10.0, but I'd rather use a single dependency version everywhere.

@hallettj hallettj merged commit 687d1d0 into main Jan 22, 2025
1 check passed
@hallettj hallettj deleted the jessehallett/eng-1351-test-ndc-spec-v02-in-mongodb branch January 22, 2025 19:31
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.

2 participants