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

feat: add bft function testcases in new substrait testfile format #738

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

srikrishnak
Copy link
Contributor

No description provided.

@srikrishnak
Copy link
Contributor Author

The breaking changes check failure is not related to this commit. It pointed to changes in update rel. Once we rebase, it will pass.

@srikrishnak srikrishnak changed the title chore: port tests from bft to substrait feat: add bft function testcases in new substrait testfile format Nov 12, 2024
@jacques-n
Copy link
Contributor

We should get CI running first for the coverage code before adding these. That way we won't accidentally add broken things.

Second, we should also add the automated tool that does the conversion so other people can use it if they have their own tests.

Copy link
Member

@EpsilonPrime EpsilonPrime left a comment

Choose a reason for hiding this comment

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

This turned into a review of the BFT source testcases since the conversion process is working correctly.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see the count_star test file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The count_star() function name doesn't match any function in substrait functions. So, unable to add it as coverage breaks.

tests/cases/arithmetic/bitwise_or.test Outdated Show resolved Hide resolved
tests/cases/arithmetic/bitwise_or.test Show resolved Hide resolved
tests/cases/arithmetic/max.test Outdated Show resolved Hide resolved
tests/cases/arithmetic/min.test Outdated Show resolved Hide resolved
tests/cases/string/like.test Show resolved Hide resolved
lower('aBc'::str) = 'abc'::str
lower('abc'::str) = 'abc'::str
lower(''::str) = ''::str

Copy link
Member

Choose a reason for hiding this comment

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

future: we are going to need to revisit all of the string cases once we add collation and character set. (For instance, the capital letter I in Turkish does not become i but a version without a dot.)

tests/cases/string/regexp_replace.test Outdated Show resolved Hide resolved
repeat(''::str, 2::i64) = ''::str

# null_input: Examples with null as input
repeat(null::str, 2::i64) = null::str
Copy link
Member

Choose a reason for hiding this comment

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

later: add tests for null and negative counts

tests/cases/string/starts_with.test Show resolved Hide resolved
@srikrishnak
Copy link
Contributor Author

We should get CI running first for the coverage code before adding these. That way we won't accidentally add broken things.

Second, we should also add the automated tool that does the conversion so other people can use it if they have their own tests.

Raised a bft PR substrait-io/bft#97 for the script as well.

@srikrishnak
Copy link
Contributor Author

I took care of review comments but had to rebase because of conflicting file.
After rebase, I new counter in coverage pointed to around 400 signature matches although the testcases would pass on bft.

Below are the different cases which caused signature mismatches even for functions which have the right test cases, addressed almost all of them (4 is not yet fixed). Now I am left with around 250 odd test cases. Now, mostly I see failures which are actual signature mismatches or (4.)

  1. tests with return type SubstraitError()
  2. tests for functions like or having variadic arguments
  3. tests with return type decimal
  4. tests with return type any1
  5. tests with return type any

@srikrishnak
Copy link
Contributor Author

I took care of review comments but had to rebase because of conflicting file. After rebase, I new counter in coverage pointed to around 400 signature matches although the testcases would pass on bft.

Below are the different cases which caused signature mismatches even for functions which have the right test cases, addressed almost all of them (4 is not yet fixed). Now I am left with around 250 odd test cases. Now, mostly I see failures which are actual signature mismatches or (4.)

  1. tests with return type SubstraitError()
  2. tests for functions like or having variadic arguments
  3. tests with return type decimal
  4. tests with return type any1
  5. tests with return type any

raised PR #744 to fix issues with function lookup in coverage tool.
This PR will need rebase on #744

@srikrishnak srikrishnak force-pushed the port-bft-tests branch 2 times, most recently from b9a17c8 to 16ce9ed Compare November 19, 2024 17:52
EpsilonPrime
EpsilonPrime previously approved these changes Nov 19, 2024
Copy link
Member

@EpsilonPrime EpsilonPrime left a comment

Choose a reason for hiding this comment

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

There's still the question of extract with microsecond but since that's mirroring the existing test it's fine to investigate it later.

@srikrishnak
Copy link
Contributor Author

I raised a draft PR substrait-io/bft#98 to check how pipeline runs go with these testcases on bft.

@srikrishnak
Copy link
Contributor Author

I raised a draft PR substrait-io/bft#98 to check how pipeline runs go with these testcases on bft.

I checked locally by using the DRAFT PR for duckdb, snowflake, postgres and sqllite. Made sure there are no regressions on them.

The previous patch had one offending test case for sqllite, removed that testcase.

Copy link
Contributor

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

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

Great work @srikrishnak and @EpsilonPrime ! Thanks for thorough update and review.

@jacques-n jacques-n merged commit d84ccd1 into substrait-io:main Nov 21, 2024
13 checks passed
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.

3 participants