Skip to content

Conversation

@walterddr
Copy link
Contributor

@walterddr walterddr commented Oct 25, 2022

null handling was only tested against FLOAT and DOUBLE peviously

  • null value test for more types
  • add null integration test

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2022

Codecov Report

Merging #9657 (2605368) into master (3de1c54) will decrease coverage by 7.30%.
The diff coverage is n/a.

@@             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     
Flag Coverage Δ
integration1 25.88% <ø> (+0.01%) ⬆️
unittests1 67.43% <ø> (+0.09%) ⬆️
unittests2 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...pinot/controller/recommender/io/ConfigManager.java 0.00% <0.00%> (-100.00%) ⬇️
.../org/apache/pinot/client/AggregationResultSet.java 0.00% <0.00%> (-100.00%) ⬇️
...ntroller/recommender/rules/impl/JsonIndexRule.java 0.00% <0.00%> (-100.00%) ⬇️
...routing/adaptiveserverselector/HybridSelector.java 0.00% <0.00%> (-100.00%) ⬇️
...troller/recommender/io/metadata/FieldMetadata.java 0.00% <0.00%> (-100.00%) ⬇️
...outing/adaptiveserverselector/LatencySelector.java 0.00% <0.00%> (-100.00%) ⬇️
...roller/recommender/rules/impl/BloomFilterRule.java 0.00% <0.00%> (-100.00%) ⬇️
...oller/api/resources/PinotControllerAppConfigs.java 0.00% <0.00%> (-100.00%) ⬇️
...ler/recommender/data/generator/BytesGenerator.java 0.00% <0.00%> (-100.00%) ⬇️
...er/recommender/io/metadata/SchemaWithMetaData.java 0.00% <0.00%> (-100.00%) ⬇️
... and 292 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@walterddr walterddr marked this pull request as ready for review October 25, 2022 21:55
} 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);
Copy link
Member

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?

Copy link
Contributor Author

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);
Copy link
Member

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);

Copy link
Contributor Author

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

Comment on lines +235 to +238
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},
Copy link
Contributor Author

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.

Comment on lines +244 to +254
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},
Copy link
Contributor Author

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

Copy link
Contributor

@nizarhejazi nizarhejazi Oct 26, 2022

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).

Copy link
Contributor Author

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

Comment on lines +329 to +330
// TODO fix String null value handling
if (dataType != ColumnDataType.STRING) {
Copy link
Contributor Author

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

Copy link
Contributor

@nizarhejazi nizarhejazi Oct 26, 2022

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.

Copy link
Contributor Author

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?

@nizarhejazi
Copy link
Contributor

nizarhejazi commented Oct 26, 2022

@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 big decimal type).
  • AllNullQueriesTest (Dict and non-dict Long, Float, Double, Int, String and BigDecimal types).

@walterddr
Copy link
Contributor Author

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

@walterddr walterddr closed this Oct 26, 2022
@walterddr walterddr deleted the null_itcase branch December 6, 2023 16:21
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.

4 participants