You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/09/04 15:49:06 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #10338: Vectorized ANY aggregators

suneet-s commented on a change in pull request #10338:
URL: https://github.com/apache/druid/pull/10338#discussion_r483674764



##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);
+
+  /**
+   * Place the primitive null value in the buffer, fiven the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putNonNullValue(ByteBuffer buf, int position, Object value);
+
+  @Override
+  public void init(ByteBuffer buf, int position)
+  {
+    buf.put(position, replaceWithDefault ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE);
+    initValue(buf, position);
+  }
+
+  @Override
+  public void aggregate(ByteBuffer buf, int position, int startRow, int endRow)
+  {
+    if ((buf.get(position) & BYTE_FLAG_FOUND_MASK) != BYTE_FLAG_FOUND_MASK) {
+      boolean[] nulls = vectorValueSelector.getNullVector();
+      // check if there are any nulls
+      if (nulls != null && startRow <= nulls.length) {

Review comment:
       Fixed.

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);
+
+  /**
+   * Place the primitive null value in the buffer, fiven the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putNonNullValue(ByteBuffer buf, int position, Object value);
+
+  @Override
+  public void init(ByteBuffer buf, int position)
+  {
+    buf.put(position, replaceWithDefault ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE);
+    initValue(buf, position);
+  }
+
+  @Override
+  public void aggregate(ByteBuffer buf, int position, int startRow, int endRow)
+  {
+    if ((buf.get(position) & BYTE_FLAG_FOUND_MASK) != BYTE_FLAG_FOUND_MASK) {
+      boolean[] nulls = vectorValueSelector.getNullVector();
+      // check if there are any nulls
+      if (nulls != null && startRow <= nulls.length) {
+        for (int i = startRow; i < endRow; i++) {
+          // And there is actually a null
+          if (nulls[i]) {
+            putNull(buf, position);
+            return;
+          }
+        }
+      }
+      // There are no nulls, so put a value from the value selector
+      putValue(buf, position, startRow);
+      buf.put(position, (byte) (BYTE_FLAG_FOUND_MASK | NullHandling.IS_NOT_NULL_BYTE));
+    }
+  }
+
+  @Override
+  public void aggregate(
+      ByteBuffer buf,
+      int numRows,
+      int[] positions,
+      @Nullable int[] rows,
+      int positionOffset
+  )
+  {
+    for (int i = 0; i < numRows; i++) {
+      int position = positions[i] + positionOffset;
+      int row = rows == null ? i : rows[i];
+      aggregate(buf, position, row, row);

Review comment:
       yes 😬 

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyAggregatorFactory.java
##########
@@ -77,6 +81,33 @@ public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory)
     return new StringAnyBufferAggregator(metricFactory.makeColumnValueSelector(fieldName), maxStringBytes);
   }
 
+  @Override
+  public StringAnyVectorAggregator factorizeVector(VectorColumnSelectorFactory selectorFactory)
+  {
+
+    ColumnCapabilities capabilities = selectorFactory.getColumnCapabilities(fieldName);
+    if (capabilities == null || capabilities.hasMultipleValues().isMaybeTrue()) {
+      return new StringAnyVectorAggregator(
+          null,
+          selectorFactory.makeMultiValueDimensionSelector(DefaultDimensionSpec.of(fieldName)),
+          maxStringBytes
+      );
+    } else {
+      return new StringAnyVectorAggregator(
+          selectorFactory.makeSingleValueDimensionSelector(DefaultDimensionSpec.of(fieldName)),
+          null,
+          maxStringBytes
+      );
+    }
+  }
+
+  @Override
+  public boolean canVectorize(ColumnInspector columnInspector)
+  {
+    ColumnCapabilities capabilities = columnInspector.getColumnCapabilities(fieldName);
+    return capabilities == null || capabilities.getType() == ValueType.STRING;

Review comment:
       ```
    /**
      * Returns capabilities of a particular column, if known. May be null if the column doesn't exist, or if
      * the column does exist but the capabilities are unknown. The latter is possible with dynamically discovered
      * columns.
      *
      * Note that StorageAdapters are representations of "real" segments, so they are not aware of any virtual columns
      * that may be involved in a query. In general, query engines should instead use the method
      * {@link ColumnSelectorFactory#getColumnCapabilities(String)}, which returns capabilities for virtual columns as
      * well.
      *
      * @param column column name
      *
      * @return capabilities, or null
      */
     @Override
     @Nullable
     ColumnCapabilities getColumnCapabilities(String column);
   ```
   
   I found this explanation in `StorageAdapter#getColumnCapabilities`

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);

Review comment:
       Refactored to `boolean putAnyValueFromRow(ByteBuffer buf, int position, int startRow, int endRow)`

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);
+
+  /**
+   * Place the primitive null value in the buffer, fiven the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putNonNullValue(ByteBuffer buf, int position, Object value);
+
+  @Override
+  public void init(ByteBuffer buf, int position)
+  {
+    buf.put(position, replaceWithDefault ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE);
+    initValue(buf, position);
+  }
+
+  @Override
+  public void aggregate(ByteBuffer buf, int position, int startRow, int endRow)
+  {
+    if ((buf.get(position) & BYTE_FLAG_FOUND_MASK) != BYTE_FLAG_FOUND_MASK) {
+      boolean[] nulls = vectorValueSelector.getNullVector();
+      // check if there are any nulls
+      if (nulls != null && startRow <= nulls.length) {
+        for (int i = startRow; i < endRow; i++) {
+          // And there is actually a null
+          if (nulls[i]) {
+            putNull(buf, position);
+            return;
+          }
+        }
+      }
+      // There are no nulls, so put a value from the value selector
+      putValue(buf, position, startRow);
+      buf.put(position, (byte) (BYTE_FLAG_FOUND_MASK | NullHandling.IS_NOT_NULL_BYTE));
+    }
+  }
+
+  @Override
+  public void aggregate(
+      ByteBuffer buf,
+      int numRows,
+      int[] positions,
+      @Nullable int[] rows,
+      int positionOffset
+  )
+  {
+    for (int i = 0; i < numRows; i++) {
+      int position = positions[i] + positionOffset;
+      int row = rows == null ? i : rows[i];
+      aggregate(buf, position, row, row);

Review comment:
       I tried that earlier and it failed a test with subqueries - https://github.com/apache/druid/pull/10338#discussion_r483319566

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);
+
+  /**
+   * Place the primitive null value in the buffer, fiven the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putNonNullValue(ByteBuffer buf, int position, Object value);
+
+  @Override
+  public void init(ByteBuffer buf, int position)
+  {
+    buf.put(position, replaceWithDefault ? NullHandling.IS_NOT_NULL_BYTE : NullHandling.IS_NULL_BYTE);
+    initValue(buf, position);
+  }
+
+  @Override
+  public void aggregate(ByteBuffer buf, int position, int startRow, int endRow)
+  {
+    if ((buf.get(position) & BYTE_FLAG_FOUND_MASK) != BYTE_FLAG_FOUND_MASK) {
+      boolean[] nulls = vectorValueSelector.getNullVector();
+      // check if there are any nulls
+      if (nulls != null && startRow <= nulls.length) {
+        for (int i = startRow; i < endRow; i++) {
+          // And there is actually a null
+          if (nulls[i]) {
+            putNull(buf, position);
+            return;
+          }
+        }
+      }
+      // There are no nulls, so put a value from the value selector
+      putValue(buf, position, startRow);
+      buf.put(position, (byte) (BYTE_FLAG_FOUND_MASK | NullHandling.IS_NOT_NULL_BYTE));
+    }
+  }
+
+  @Override
+  public void aggregate(

Review comment:
       added now. Was in progress when I pushed the last patch up.

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;
+
+  private final boolean replaceWithDefault = NullHandling.replaceWithDefault();
+  protected final VectorValueSelector vectorValueSelector;
+
+  public NumericAnyVectorAggregator(VectorValueSelector vectorValueSelector)
+  {
+    this.vectorValueSelector = vectorValueSelector;
+  }
+
+  /**
+   * Initialize the buffer value given the initial offset position within the byte buffer for initialization
+   */
+  abstract void initValue(ByteBuffer buf, int position);
+
+  /**
+   * Place the primitive value in the buffer given the initial offset position within the byte buffer
+   * at which the current aggregate value is stored.
+   */
+  abstract void putValue(ByteBuffer buf, int position, int row);
+
+  /**
+   * Place the primitive null value in the buffer, fiven the initial offset position within the byte buffer

Review comment:
       updated the function to just `putZero`

##########
File path: processing/src/main/java/org/apache/druid/query/aggregation/any/NumericAnyVectorAggregator.java
##########
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.query.aggregation.any;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.common.config.NullHandling;
+import org.apache.druid.query.aggregation.VectorAggregator;
+import org.apache.druid.segment.vector.VectorValueSelector;
+
+import javax.annotation.Nullable;
+import java.nio.ByteBuffer;
+
+public abstract class NumericAnyVectorAggregator implements VectorAggregator
+{
+  // Rightmost bit for is null check (0 for is null and 1 for not null)
+  // Second rightmost bit for is found check (0 for not found and 1 for found)
+  @VisibleForTesting
+  static final byte BYTE_FLAG_FOUND_MASK = 0x02;
+  private static final byte BYTE_FLAG_NULL_MASK = 0x01;
+  protected static final int FOUND_VALUE_OFFSET = Byte.BYTES;

Review comment:
       good suggestion! Done.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org