Skip to content

Commit 96a7117

Browse files
committed
count_distinct
1 parent fd6f71c commit 96a7117

File tree

7 files changed

+0
-58
lines changed

7 files changed

+0
-58
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctBooleanAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ public static void combine(GroupingState current, int groupId, boolean v) {
5050
current.collect(groupId, v);
5151
}
5252

53-
public static void combineStates(GroupingState current, int currentGroupId, GroupingState state, int statePosition) {
54-
current.combineStates(currentGroupId, state);
55-
}
56-
5753
public static void combineIntermediate(GroupingState current, int groupId, boolean fbit, boolean tbit) {
5854
if (fbit) current.bits.set(groupId * 2);
5955
if (tbit) current.bits.set(groupId * 2 + 1);
@@ -120,11 +116,6 @@ void collect(int groupId, boolean v) {
120116
trackGroupId(groupId);
121117
}
122118

123-
void combineStates(int currentGroupId, GroupingState state) {
124-
bits.or(state.bits);
125-
trackGroupId(currentGroupId);
126-
}
127-
128119
/** Extracts an intermediate view of the contents of this state. */
129120
@Override
130121
public void toIntermediate(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ public static void combineIntermediate(HllStates.GroupingState current, int grou
5050
current.merge(groupId, inValue, 0);
5151
}
5252

53-
public static void combineStates(
54-
HllStates.GroupingState current,
55-
int currentGroupId,
56-
HllStates.GroupingState state,
57-
int statePosition
58-
) {
59-
current.merge(currentGroupId, state.hll, statePosition);
60-
}
61-
6253
public static Block evaluateFinal(HllStates.GroupingState state, IntVector selected, DriverContext driverContext) {
6354
try (LongBlock.Builder builder = driverContext.blockFactory().newLongBlockBuilder(selected.getPositionCount())) {
6455
for (int i = 0; i < selected.getPositionCount(); i++) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ public static void combineIntermediate(HllStates.GroupingState current, int grou
5050
current.merge(groupId, inValue, 0);
5151
}
5252

53-
public static void combineStates(
54-
HllStates.GroupingState current,
55-
int currentGroupId,
56-
HllStates.GroupingState state,
57-
int statePosition
58-
) {
59-
current.merge(currentGroupId, state.hll, statePosition);
60-
}
61-
6253
public static Block evaluateFinal(HllStates.GroupingState state, IntVector selected, DriverContext driverContext) {
6354
try (LongBlock.Builder builder = driverContext.blockFactory().newLongBlockBuilder(selected.getPositionCount())) {
6455
for (int i = 0; i < selected.getPositionCount(); i++) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ public static void combineIntermediate(HllStates.GroupingState current, int grou
5050
current.merge(groupId, inValue, 0);
5151
}
5252

53-
public static void combineStates(
54-
HllStates.GroupingState current,
55-
int currentGroupId,
56-
HllStates.GroupingState state,
57-
int statePosition
58-
) {
59-
current.merge(currentGroupId, state.hll, statePosition);
60-
}
61-
6253
public static Block evaluateFinal(HllStates.GroupingState state, IntVector selected, DriverContext driverContext) {
6354
try (LongBlock.Builder builder = driverContext.blockFactory().newLongBlockBuilder(selected.getPositionCount())) {
6455
for (int i = 0; i < selected.getPositionCount(); i++) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctIntAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ public static void combineIntermediate(HllStates.GroupingState current, int grou
5050
current.merge(groupId, inValue, 0);
5151
}
5252

53-
public static void combineStates(
54-
HllStates.GroupingState current,
55-
int currentGroupId,
56-
HllStates.GroupingState state,
57-
int statePosition
58-
) {
59-
current.merge(currentGroupId, state.hll, statePosition);
60-
}
61-
6253
public static Block evaluateFinal(HllStates.GroupingState state, IntVector selected, DriverContext driverContext) {
6354
try (LongBlock.Builder builder = driverContext.blockFactory().newLongBlockBuilder(selected.getPositionCount())) {
6455
for (int i = 0; i < selected.getPositionCount(); i++) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountDistinctLongAggregator.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ public static void combineIntermediate(HllStates.GroupingState current, int grou
5050
current.merge(groupId, inValue, 0);
5151
}
5252

53-
public static void combineStates(
54-
HllStates.GroupingState current,
55-
int currentGroupId,
56-
HllStates.GroupingState state,
57-
int statePosition
58-
) {
59-
current.merge(currentGroupId, state.hll, statePosition);
60-
}
61-
6253
public static Block evaluateFinal(HllStates.GroupingState state, IntVector selected, DriverContext driverContext) {
6354
try (LongBlock.Builder builder = driverContext.blockFactory().newLongBlockBuilder(selected.getPositionCount())) {
6455
for (int i = 0; i < selected.getPositionCount(); i++) {

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/HllStates.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ long cardinality(int groupId) {
168168
return hll.cardinality(groupId);
169169
}
170170

171-
void merge(int groupId, AbstractHyperLogLogPlusPlus other, int otherGroup) {
172-
hll.merge(groupId, other, otherGroup);
173-
}
174-
175171
void merge(int groupId, BytesRef other, int otherGroup) {
176172
hll.merge(groupId, deserializeHLL(other), otherGroup);
177173
}

0 commit comments

Comments
 (0)