Skip to content

Port remaining information_schema rust tests to sqllogictests #7050

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 5 commits into from
Jul 27, 2023

Conversation

palash25
Copy link
Contributor

@palash25 palash25 commented Jul 21, 2023

Which issue does this PR close?

Closes: #6301

Rationale for this change

This ports the remaining information_schema tests to sqllogic tests

What changes are included in this PR?

The file containing rust tests for information schema has been completely deleted. And the 3 rust tests from that file have been ported to sql logic tests residing in a separate .slt file

Are these changes tested?

Yes i did run cargo test there were a few ignored tests but no failures

Are there any user-facing changes?

No

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Jul 21, 2023
@palash25
Copy link
Contributor Author

I ported these tests to a new .slt file since one of the tests creates multiple catalogs it changes the results of some existing tests and causes a few errors in the information_schema.slt file because there I could not find a way to clean up the created catalogs.

I was not able to port two things because I wasn't able to figure out a valid SQL syntax to do so:

@alamb
Copy link
Contributor

alamb commented Jul 21, 2023

Thank you so much @palash25 -- 😍

In terms of setups that can not be achieved via SQL today, I recommend we follow the approach of some other similar tests and set them up programatically (move the setup rust code into sqllogictest):

https://github.com/apache/arrow-datafusion/blob/368f6e606a3cfca8e04638b8d5ff0ff116a20b57/datafusion/core/tests/sqllogictests/src/main.rs#L269-L296

Does that make sense?

@palash25
Copy link
Contributor Author

thank you, i didn't know we could use rust code with logic tests, i will take a look at this tomorrow and try to finish it up

Closes: apache#6301

Signed-off-by: Palash Nigam <npalash25@gmail.com>
@palash25 palash25 marked this pull request as ready for review July 26, 2023 08:00
@palash25
Copy link
Contributor Author

@alamb its ready for review. I used rust code to set things up for two of the tests as you suggested:

  • one for creating local temporary table
  • the other for setting nullable fields correctly

I had to split the tests into separate .slt files because even though i was able to set things up correctly with setup.rs there was no way to cleanup things properly and that would mess with the output of some other test. Hope thats ok.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This looks great @palash25 -- thank you very much 🙏

@alamb
Copy link
Contributor

alamb commented Jul 26, 2023

I took the liberty of merging up from main and fixing the clippy error on this PR. Hopefully we can get it merged tomorrow. Thanks again @palash25

@palash25
Copy link
Contributor Author

thanks for the clippy fixes, i didn't notice them. I just pushed a small commit removing unnecessary comments that were left out in the original commit. Looking forward to contributing more in the future, it was a really nice experience to contribute to this project. 😄

@alamb
Copy link
Contributor

alamb commented Jul 27, 2023

Looking forward to contributing more in the future, it was a really nice experience to contribute to this project. 😄

Thank you for saying so. We strive to make it pleasant and have people work well together as a community so it is nice to have that acknowledged

@alamb alamb merged commit 69d096a into apache:main Jul 27, 2023
@palash25 palash25 deleted the infoschema-tests branch July 27, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port tests in information_schema.rs to sqllogictest
2 participants