-
Notifications
You must be signed in to change notification settings - Fork 3
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
update for ndc-spec v0.2 #139
Conversation
…t, but getting int
@@ -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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
crates/mongodb-agent-common/src/query/make_selector/make_aggregation_expression.rs
Show resolved
Hide resolved
...snapshots/integration_tests__tests__aggregation__runs_aggregation_over_top_level_fields.snap
Show resolved
Hide resolved
@@ -87,6 +86,7 @@ pub fn make_nested_schema() -> MongoConfiguration { | |||
} | |||
|
|||
/// Configuration for a MongoDB database with Chinook test data | |||
#[allow(dead_code)] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -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()), |
There was a problem hiding this comment.
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.
Updates the MongoDB connector for ndc-spec v0.2 (changelog link)
The connector processes requests in two phases:
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.mongodb-agent-common
consumes those internal types to produce mongodb query plansThis PR requires updates to both phases, including changes to the internal request types.
PR Progress
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.