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

Minor: remove duplicated array_replace tests #8066

Merged
merged 4 commits into from
Nov 11, 2023
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Nov 6, 2023

Which issue does this PR close?

Part of #7988

Rationale for this change

As pointed out by @jayzhan211 in #8054 (comment), sqllogictests tests are easier to maintain and also cover the logic end to end.

I was going to port the rest of the tests for array_replace to array.slt and when I went to do so I found out they were already there.

What changes are included in this PR?

  1. Remove unit tests from array_expressions.rs
  2. Reformat tests in array.slt to make it clearer what is tested (and in particular all the cases are already covered)

Are these changes tested?

Yes, by existing tests

Are there any user-facing changes?

No

@github-actions github-actions bot added physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Nov 6, 2023
@alamb alamb marked this pull request as ready for review November 6, 2023 16:56
select array_replace(make_array([1, 2, 3], [4, 5, 6], [5, 5, 5], [4, 5, 6], [7, 8, 9]), [4, 5, 6], [1, 1, 1]), array_replace(make_array([1, 3, 2], [2, 3, 4], [2, 3, 4], [5, 3, 1], [1, 3, 2]), [2, 3, 4], [3, 1, 4]);
select
array_replace(
make_array([1, 2, 3], [4, 5, 6], [5, 5, 5], [4, 5, 6], [7, 8, 9]),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

by rewriting with some whitespace, I think it is much easier now to see what this test is covering

@alamb
Copy link
Contributor Author

alamb commented Nov 6, 2023

I wonder what you think of this @jayzhan211 ? If you agree that this is an improvement, I can do the same for the other tests in array_expressions.rs.

@jayzhan211
Copy link
Contributor

jayzhan211 commented Nov 6, 2023

I wonder what you think of this @jayzhan211 ? If you agree that this is an improvement, I can do the same for the other tests in array_expressions.rs.

Nice improvement. We should move test to slt file if possible!

@alamb alamb requested a review from jackwener November 9, 2023 13:42
Copy link
Member

@jackwener jackwener left a comment

Choose a reason for hiding this comment

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

@alamb alamb merged commit 4068b06 into apache:main Nov 11, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants