Skip to content
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

Move identifer case tests to sql_integ, add negative cases, Debug for DataFrame #2243

Merged
merged 4 commits into from
Apr 16, 2022

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Apr 15, 2022

Which issue does this PR close?

Closes #2227

Rationale for this change

Basically so that it is clear what types of identifier comparisons are meant to work

Also, Re cleaning up tests #743

What changes are included in this PR?

  1. Move normalized column identifier tests into sql_integration to hopefully make them more discoverable
  2. Add a negative case (where the query fails) adapted from the great one from @ReggieFan on fix: ‘Invalid identifier #xxx’ caused by Case-to-case conversion in SQL #2211 to make it clear this is expected behavior
  3. Add some Debug impls, so I can use unwrap_err()

Are there any user-facing changes?

Debug impl for DataFame and SessionContext

@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Apr 15, 2022
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SessionState")
.field("session_id", &self.session_id)
// TODO should we print out more?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are a lot of other fields on SessionState -- I wasn't sure the value of printing them, so I left it as a future todo

@@ -3322,173 +3334,6 @@ mod tests {
Ok(())
}

#[tokio::test]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved out of context.rs and into datafusion/core/tests/sql/idenfifers.rs without change

}

#[tokio::test]
async fn case_insensitive_in_sql_errors() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a new test added in this PR, based on the one from @ReggieFan on #2211 to make it clear this is expected behavior

@yjshen yjshen merged commit f5592cf into apache:master Apr 16, 2022
@alamb alamb deleted the alamb/identifer_test branch August 8, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit test for case-sensitive SQL identifiers
3 participants