-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[multistage] add test for LiteralValueOperator #9796
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9796 +/- ##
=============================================
- Coverage 70.17% 25.20% -44.98%
+ Complexity 5407 44 -5363
=============================================
Files 1956 1944 -12
Lines 104975 104622 -353
Branches 15892 15854 -38
=============================================
- Hits 73669 26369 -47300
- Misses 26157 75546 +49389
+ Partials 5149 2707 -2442
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we also want to add a simple test for input null / empty and the operator shouldn't NPE or anything, return empty.
// Then: | ||
Assert.assertEquals(transferableBlock.getContainer().get(0), new Object[]{"foo", 1}); | ||
Assert.assertEquals(transferableBlock.getContainer().get(1), new Object[]{"bar", 2}); | ||
Assert.assertTrue(operator.nextBlock().isEndOfStreamBlock(), "Expected EOS after reading two rows"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add a test for literals that are empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added, but how can you create an empty literal in first place (in SQL)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SELECT col1 FROM tbl WHERE col2 BETWEEN 0 AND -1
will generate an empty literal value node with schema of col1 and 0 rows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. but also could you add test for empty literals?
Super quick and easy test :)