removed unnecessary else
diff --git a/src/main/java/com/yahoo/sketches/pig/quantiles/GetQuantilesFromStringsSketch.java b/src/main/java/com/yahoo/sketches/pig/quantiles/GetQuantilesFromStringsSketch.java
index 4f71999..9a381d6 100644
--- a/src/main/java/com/yahoo/sketches/pig/quantiles/GetQuantilesFromStringsSketch.java
+++ b/src/main/java/com/yahoo/sketches/pig/quantiles/GetQuantilesFromStringsSketch.java
@@ -52,17 +52,17 @@
throw new IllegalArgumentException("expected a double value as a fraction or an integer value"
+ " as a number of evenly spaced intervals, got " + arg.getClass().getSimpleName());
}
- } else { // more than one number - must be double fractions
- final double[] fractions = new double[input.size() - 1];
- for (int i = 1; i < input.size(); i++) {
- if (!(input.get(i) instanceof Double)) {
- throw new IllegalArgumentException(
- "expected a double value as a fraction, got " + input.get(i).getClass().getSimpleName());
- }
- fractions[i - 1] = (double) input.get(i);
- }
- return TupleFactory.getInstance().newTuple(Arrays.asList(sketch.getQuantiles(fractions)));
}
+ // more than one number - must be double fractions
+ final double[] fractions = new double[input.size() - 1];
+ for (int i = 1; i < input.size(); i++) {
+ if (!(input.get(i) instanceof Double)) {
+ throw new IllegalArgumentException(
+ "expected a double value as a fraction, got " + input.get(i).getClass().getSimpleName());
+ }
+ fractions[i - 1] = (double) input.get(i);
+ }
+ return TupleFactory.getInstance().newTuple(Arrays.asList(sketch.getQuantiles(fractions)));
}
}
diff --git a/src/main/java/com/yahoo/sketches/pig/sampling/ReservoirSampling.java b/src/main/java/com/yahoo/sketches/pig/sampling/ReservoirSampling.java
index 23b76f1..1db8e39 100644
--- a/src/main/java/com/yahoo/sketches/pig/sampling/ReservoirSampling.java
+++ b/src/main/java/com/yahoo/sketches/pig/sampling/ReservoirSampling.java
@@ -68,9 +68,8 @@
// if entire input data fits in reservoir, shortcut result
if (samples.size() <= targetK_) {
return createResultTuple(samples.size(), targetK_, samples);
- } else {
- return super.exec(inputTuple);
}
+ return super.exec(inputTuple);
}
@Override