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

fix: set nullability correctly in testcase parser #110

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

scgkiran
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 96.55172% with 2 lines in your changes missing coverage. Please review.

Project coverage is 63.03%. Comparing base (3fcd4ed) to head (d4ba321).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
testcases/parser/visitor.go 96.49% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
- Coverage   63.04%   63.03%   -0.01%     
==========================================
  Files          44       44              
  Lines       10610    10627      +17     
==========================================
+ Hits         6689     6699      +10     
- Misses       3621     3628       +7     
  Partials      300      300              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

testcases/parser/parse_test.go Show resolved Hide resolved
{testCaseStr: "f20(('abcd', 'ef')::varchar<9>) = Null::vchar<9>", expTestStr: "f20(('abcd', 'ef')::varchar<9>) = null::varchar<9>"},
{testCaseStr: "f20(('abcd', 'ef')::fbin<9>) = Null::fbin<9>", expTestStr: "f20(('abcd', 'ef')::fixedbinary<9>) = null::fixedbinary<9>"},
{testCaseStr: "f20(('abcd', 'ef')::fixedbinary?<9>) = Null::fixedbinary<9>", expTestStr: "f20(('abcd', 'ef')::fixedbinary?<9>) = null::fixedbinary<9>"},
{testCaseStr: `DEFINE t1(varchar<5>) = (('cat'), ('bat'), ('rat'), (null))
Copy link
Member

Choose a reason for hiding this comment

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

Should this be varchar<5>??

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 type is associated with column argument, in this case number of arguments is zero.
Added another test with one argument

Copy link
Member

Choose a reason for hiding this comment

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

It looks like null is one of the possible values but varchar<5> isn't nullable. That seems like something that should cause an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That needs, substrait PR for grammar changes to be merged, to handle all cases. Currently we have ? support only for composite types.

testcases/parser/parse_test.go Outdated Show resolved Hide resolved
testcases/parser/visitor.go Show resolved Hide resolved
@scgkiran scgkiran merged commit 1aaa0fa into substrait-io:main Jan 24, 2025
8 checks passed
@scgkiran scgkiran deleted the nullability branch January 24, 2025 22:18
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