FrankChen021 commented on code in PR #19823:
URL: https://github.com/apache/druid/pull/19823#discussion_r3686802596
##########
processing/src/test/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcherTest.java:
##########
@@ -381,8 +381,8 @@ public void doesNotLoadIfPresent()
@Test
public void evictsLeastRecentlyUsed()
{
- Long start = 1L;
- Long next = start + SIZE;
+ final long start = 1L;
+ final Long next = start + SIZE;
for (long i = start; i < next; i++) {
Long key = i;
Review Comment:
Fixed in 62678a7841: next and key are primitive long values, and assertions
explicitly compare primitive actual values to avoid overload ambiguity and
boxing.
##########
processing/src/main/java/org/apache/druid/segment/generator/ColumnValueGenerator.java:
##########
@@ -207,8 +208,12 @@ private void initDistribution()
distribution = new UniformIntegerDistribution(schema.getStartInt(),
schema.getEndInt());
break;
case ENUMERATED:
- for (int i = 0; i < enumeratedValues.size(); i++) {
- probabilities.add(new Pair<>(enumeratedValues.get(i),
enumeratedProbabilities.get(i)));
+ final List<Object> nonNullEnumeratedValues =
+ Preconditions.checkNotNull(enumeratedValues, "enumeratedValues");
+ final List<Double> nonNullEnumeratedProbabilities =
+ Preconditions.checkNotNull(enumeratedProbabilities,
"enumeratedProbabilities");
+ for (int i = 0; i < nonNullEnumeratedValues.size(); i++) {
+ probabilities.add(new Pair<>(nonNullEnumeratedValues.get(i),
nonNullEnumeratedProbabilities.get(i)));
}
Review Comment:
Fixed in 62678a7841: ENUMERATED generation now validates that values and
probabilities have equal sizes and reports both sizes. DataGeneratorTest covers
the mismatched-list failure.
##########
sql/src/main/java/org/apache/druid/sql/calcite/aggregation/builtin/EarliestLatestAnySqlAggregator.java:
##########
@@ -254,20 +254,22 @@ public Aggregation toDruidAggregation(
case 1:
theAggFactory = aggregatorType.createAggregatorFactory(aggregatorName,
fieldName, null, outputType, null, true);
break;
- case 2:
- Integer maxStringBytes = RexLiteral.intValue(rexNodes.get(1)); //
added not null check at the function
+ case 2: {
+ final int maxStringBytes = RexLiteral.intValue(rexNodes.get(1)); //
added not null check at the function
Review Comment:
Fixed in 62678a7841: both misleading null-check comments were removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]