-
Notifications
You must be signed in to change notification settings - Fork 1.4k
adding null integration test #9657
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9657 +/- ##
============================================
- Coverage 68.63% 61.33% -7.31%
- Complexity 4920 5156 +236
============================================
Files 1947 1933 -14
Lines 104168 103900 -268
Branches 15796 15770 -26
============================================
- Hits 71496 63723 -7773
- Misses 27556 35365 +7809
+ Partials 5116 4812 -304
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 |
| } else if ((int) row[keyColumnIdx] == 1) { | ||
| assertTrue(Math.abs(((Double) row[0]) - 4 * _sumKey1) < 1e-1); | ||
| assertTrue(Math.abs(((Double) row[1]) - baseValue.doubleValue()) < 1e-1); | ||
| assertTrue(Math.abs(((Double) row[0]) - 4 * _sumKey1) < PRECISION); |
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.
I saw the value of PRECISION constant is 1 in this PR, isn't it greater than 1e-1?
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.
yeah this was for integer and long in the future. but yes i can make it 1e-1 for now until we add other types
| public void tearDown() | ||
| throws Exception { | ||
| // Setting data table version back | ||
| DataTableBuilderFactory.setDataTableVersion(DataTableBuilderFactory.DEFAULT_VERSION); |
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.
Do we need to set the following to the setUp method of this integration test class as well?
// Setting data table version to 4
DataTableBuilderFactory.setDataTableVersion(DataTableFactory.VERSION_4);
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.
yeah this is a hotfix, multistage test was already setting it in setup but it wasn't set back in teardown i just happen to notice
| new Object[]{ColumnDataType.FLOAT, RANDOM.nextFloat(), true}, | ||
| new Object[]{ColumnDataType.DOUBLE, RANDOM.nextDouble(), true}, | ||
| new Object[]{ColumnDataType.FLOAT, RANDOM.nextFloat(), false}, | ||
| new Object[]{ColumnDataType.DOUBLE, RANDOM.nextDouble(), false}, |
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.
@nizarhejazi i was trying to add additional numeric test types here but the assert logic is a bit hard to generalized. please kindly take a look and see if you have better ideas.
| return new Object[][]{ | ||
| new Object[]{ColumnDataType.INT, RANDOM.nextInt(), true}, | ||
| new Object[]{ColumnDataType.LONG, RANDOM.nextInt(), true}, | ||
| new Object[]{ColumnDataType.BOOLEAN, RANDOM.nextInt(2), true}, | ||
| new Object[]{ColumnDataType.STRING, RANDOM.nextInt(), true}, | ||
| new Object[]{ColumnDataType.TIMESTAMP, RANDOM.nextInt(), true}, | ||
| new Object[]{ColumnDataType.INT, RANDOM.nextInt(), false}, | ||
| new Object[]{ColumnDataType.LONG, RANDOM.nextInt(), false}, | ||
| new Object[]{ColumnDataType.BOOLEAN, RANDOM.nextInt(2), false}, | ||
| new Object[]{ColumnDataType.STRING, RANDOM.nextInt(), false}, | ||
| new Object[]{ColumnDataType.TIMESTAMP, RANDOM.nextInt(), false}, |
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.
this list is not at all a full coverage, but good to add STRING BOOLEAN and TIMESTAMP as representatives. can add more later
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.
@walterddr NullHandling support was tested against all data types. Please check the following files:
- NullEnabledQueriesTest (Dict and non-dict Float and Double types).
- BooleanNullEnabledQueriesTest (Dict and non-dict Boolean type).
- BigDecimalQueriesTest (Dict and non-dict BigDecimal type).
- AllNullQueriesTest (Dict and non-dict Long, Float, Double, Int, String and BigDecimal types).
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.
Ah I see thanks for the info. I wasn't aware of the other tests
| // TODO fix String null value handling | ||
| if (dataType != ColumnDataType.STRING) { |
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.
looks like this query doesn't work with STRING type. might be we can take another look @nizarhejazi
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.
@walterddr There is a reason this query does not work w/ String, right? We cannot pass String column to aggregation functions (Min, Max, Avg, etc.) and we cannot use inequality operators w/ Strings.
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.
Oh I see. So we are not using comparison for min/max and null checker for count. But actually fallback to the numeric handling. Is this correct?
|
@walterddr NullHandling support was tested against all data types. Please check the following files:
|
|
looks like as @nizarhejazi mentioned the issue is not on null handling (e.g. select out null column) but on function interpretation of null values. closing this and creating a new PR for fixing the issue |
null handling was only tested against FLOAT and DOUBLE peviously