Skip to content

SQL-3268: Migrate and update (NOT) IN tests for implicit type conversion of extended JSON strings#166

Open
mattChiaravalloti wants to merge 4 commits into
mongodb:mainfrom
mattChiaravalloti:SQL-3268
Open

SQL-3268: Migrate and update (NOT) IN tests for implicit type conversion of extended JSON strings#166
mattChiaravalloti wants to merge 4 commits into
mongodb:mainfrom
mattChiaravalloti:SQL-3268

Conversation

@mattChiaravalloti

Copy link
Copy Markdown
Collaborator

This PR migrates the spec/query tests for IN and NOT IN that intended to cover implicit type conversion of extended JSON encoded strings into the e2e test suite, and updates those tests to cover the intended behavior on both sides of the operators. See the ticket for more info.

As part of this change, I realized that we were unconditionally codegenning air::MqlOperator::NotIn to $nin, which was invalid. I updated the air::MqlOperator::NotIn codepath to mimic what air::SqlOperator::NotIn does. That is, it now codegens as {$not: {$in: ... }} instead of {$nin: ...}. That was a quick drive-by fix! I considered filing a separate bug ticket, but I figured why block these new e2e tests on a bug ticket when it's just essentially a one-liner change.

This is a tech-debt ticket.

@mattChiaravalloti mattChiaravalloti requested a review from a team as a code owner July 6, 2026 19:36

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note that neither of these tests actually included coverage for implicit type conversion of extended JSON encoded strings since neither query contained such string values! That's why new tests in the e2e file look slightly different!

@jpowell-mongo jpowell-mongo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for catching this! Apologies for the miss, I should have also checked the mql codegen path along with the sql codegen path.

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