You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "gianm (via GitHub)" <gi...@apache.org> on 2024/04/25 22:20:55 UTC

[PR] Defer more expressions in vectorized groupBy. (druid)

gianm opened a new pull request, #16338:
URL: https://github.com/apache/druid/pull/16338

   This patch adds a way for columns to provide GroupByVectorColumnSelectors, which controls how the groupBy engine operates on them. This mechanism is used by ExpressionVirtualColumn to provide an ExpressionDeferredGroupByVectorColumnSelector that uses the inputs of an expression as the grouping key. The actual expression evaluation is deferred until the grouped ResultRow is created.
   
   A new context parameter "deferExpressionDimensions" allows users to control when this deferred selector is used. The default is "fixedWidthNonNumeric", which is a behavioral change from the prior behavior. Users can get the prior behavior by setting this to "singleString".
   
   Benchmarks of a few selected queries from `SqlExpressionBenchmark`:
   
   ```
   Benchmark                        (deferExpressionDimensions)  (query)  (rowsPerSegment)  (schema)  (vectorize)  Mode  Cnt     Score     Error  Units
   
   SqlExpressionBenchmark.querySql                 singleString       22           5000000      auto        force  avgt    5   260.078 ±  14.858  ms/op
   SqlExpressionBenchmark.querySql                   fixedWidth       22           5000000      auto        force  avgt    5  1970.522 ±  58.400  ms/op
   SqlExpressionBenchmark.querySql         fixedWidthNonNumeric       22           5000000      auto        force  avgt    5   263.535 ±   5.549  ms/op
   SqlExpressionBenchmark.querySql                       always       22           5000000      auto        force  avgt    5  2021.229 ± 125.010  ms/op
   
   SqlExpressionBenchmark.querySql                 singleString       24           5000000      auto        force  avgt    5   624.300 ±  36.616  ms/op
   SqlExpressionBenchmark.querySql                   fixedWidth       24           5000000      auto        force  avgt    5   889.836 ±  31.123  ms/op
   SqlExpressionBenchmark.querySql         fixedWidthNonNumeric       24           5000000      auto        force  avgt    5   646.920 ±  24.566  ms/op
   SqlExpressionBenchmark.querySql                       always       24           5000000      auto        force  avgt    5   890.384 ±  53.748  ms/op
   
   SqlExpressionBenchmark.querySql                 singleString       26           5000000      auto        force  avgt    5   824.417 ±  21.941  ms/op
   SqlExpressionBenchmark.querySql                   fixedWidth       26           5000000      auto        force  avgt    5   244.232 ±  15.514  ms/op
   SqlExpressionBenchmark.querySql         fixedWidthNonNumeric       26           5000000      auto        force  avgt    5   244.598 ±  14.268  ms/op
   SqlExpressionBenchmark.querySql                       always       26           5000000      auto        force  avgt    5   248.505 ±   8.004  ms/op
   
   SqlExpressionBenchmark.querySql                 singleString       30           5000000      auto        force  avgt    5   223.687 ±   9.362  ms/op
   SqlExpressionBenchmark.querySql                   fixedWidth       30           5000000      auto        force  avgt    5   562.844 ±  42.288  ms/op
   SqlExpressionBenchmark.querySql         fixedWidthNonNumeric       30           5000000      auto        force  avgt    5   227.850 ±   3.374  ms/op
   SqlExpressionBenchmark.querySql                       always       30           5000000      auto        force  avgt    5   562.631 ±  69.408  ms/op
   
   SqlExpressionBenchmark.querySql                 singleString       31           5000000      auto        force  avgt    5   324.208 ±   9.420  ms/op
   SqlExpressionBenchmark.querySql                   fixedWidth       31           5000000      auto        force  avgt    5  1271.630 ±  87.264  ms/op
   SqlExpressionBenchmark.querySql         fixedWidthNonNumeric       31           5000000      auto        force  avgt    5   323.169 ±   6.383  ms/op
   SqlExpressionBenchmark.querySql                       always       31           5000000      auto        force  avgt    5  1185.118 ±  34.146  ms/op
   ```


-- 
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: commits-unsubscribe@druid.apache.org

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


Re: [PR] Defer more expressions in vectorized groupBy. (druid)

Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #16338:
URL: https://github.com/apache/druid/pull/16338#discussion_r1580233502


##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -240,6 +242,25 @@
     return null;
   }
 
+  /**
+   * Returns a group-by selector. Allows virtual columns to control their own grouping behavior.
+   *
+   * @param columnName                column name
+   * @param factory                   column selector factory
+   * @param deferExpressionDimensions active value of {@link org.apache.druid.query.groupby.GroupByQueryConfig#CTX_KEY_DEFER_EXPRESSION_DIMENSIONS}
+   *
+   * @return selector, or null if this virtual column does not have a specialized one
+   */
+  @Nullable
+  default GroupByVectorColumnSelector makeGroupByVectorColumnSelector(
+      String columnName,

Review Comment:
   ## Useless parameter
   
   The parameter 'columnName' is never used.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/7313)



-- 
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: commits-unsubscribe@druid.apache.org

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


Re: [PR] Defer more expressions in vectorized groupBy. (druid)

Posted by "clintropolis (via GitHub)" <gi...@apache.org>.
clintropolis commented on code in PR #16338:
URL: https://github.com/apache/druid/pull/16338#discussion_r1643508840


##########
processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/vector/VectorGroupByEngine.java:
##########
@@ -138,12 +138,22 @@ public void close()
             try {
               final VectorColumnSelectorFactory columnSelectorFactory = cursor.getColumnSelectorFactory();
               final List<GroupByVectorColumnSelector> dimensions = query.getDimensions().stream().map(
-                  dimensionSpec ->
-                      ColumnProcessors.makeVectorProcessor(
+                  dimensionSpec -> {
+                    if (dimensionSpec instanceof DefaultDimensionSpec) {

Review Comment:
   is this just a sanity check since currently only `DefaultDimensionSpec` can vectorize, and ideally it will be the only one since `DimensionSpec` that do fancy stuff need to just be virtual columns.



##########
processing/src/main/java/org/apache/druid/segment/virtual/ExpressionDeferredGroupByVectorColumnSelector.java:
##########
@@ -0,0 +1,121 @@
+/*
+ * 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.segment.virtual;
+
+import org.apache.datasketches.memory.WritableMemory;
+import org.apache.druid.math.expr.Expr;
+import org.apache.druid.math.expr.ExpressionType;
+import org.apache.druid.math.expr.InputBindings;
+import org.apache.druid.query.groupby.ResultRow;
+import org.apache.druid.query.groupby.epinephelinae.collection.MemoryPointer;
+import org.apache.druid.query.groupby.epinephelinae.vector.GroupByVectorColumnSelector;
+import org.apache.druid.segment.column.RowSignature;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Implementation of {@link GroupByVectorColumnSelector} that uses a wide key representing all expression inputs
+ * to enable deferring expression evaluation to {@link #writeKeyToResultRow(MemoryPointer, int, ResultRow, int)}.
+ *
+ * For example, the expression "coalesce(x, y)" would write a key composed of (x, y) in {@link #writeKeys}, then
+ * compute "coalesce(x, y)" in {@link #writeKeyToResultRow}.
+ */
+public class ExpressionDeferredGroupByVectorColumnSelector implements GroupByVectorColumnSelector
+{
+  private final Expr expr;
+  private final List<GroupByVectorColumnSelector> subSelectors;
+  private final int exprKeyBytes;
+
+  /**
+   * Used internally by {@link #writeKeyToResultRow(MemoryPointer, int, ResultRow, int)} to populate inputs
+   * for the expression.
+   */
+  private final ResultRow tmpResultRow;
+
+  /**
+   * Used internally by {@link #writeKeyToResultRow(MemoryPointer, int, ResultRow, int)} to evaluate the expression
+   * on {@link #tmpResultRow}.
+   */
+  private final Expr.ObjectBinding tmpResultRowBindings;
+
+  ExpressionDeferredGroupByVectorColumnSelector(
+      final Expr expr,
+      final RowSignature exprInputSignature,
+      final List<GroupByVectorColumnSelector> subSelectors
+  )
+  {
+    this.expr = expr;
+    this.subSelectors = subSelectors;
+    this.exprKeyBytes = subSelectors.stream().mapToInt(GroupByVectorColumnSelector::getGroupingKeySize).sum();

Review Comment:
   nit: i think this should be the same size as `exprInputSignature.size()`? if true i think we should move this into that loop initializing the input bindings suppliers



##########
processing/src/main/java/org/apache/druid/query/groupby/DeferExpressionDimensions.java:
##########
@@ -0,0 +1,197 @@
+/*
+ * 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.groupby;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.druid.java.util.common.IAE;
+import org.apache.druid.math.expr.ExprType;
+import org.apache.druid.query.dimension.DimensionSpec;
+import org.apache.druid.segment.ColumnInspector;
+import org.apache.druid.segment.column.ColumnCapabilities;
+import org.apache.druid.segment.column.ValueType;
+import org.apache.druid.segment.vector.VectorColumnSelectorFactory;
+import org.apache.druid.segment.virtual.ExpressionPlan;
+import org.apache.druid.segment.virtual.ExpressionVirtualColumn;
+
+import java.util.List;
+
+/**
+ * Controls deferral of {@link ExpressionVirtualColumn} in {@link GroupByQuery}.
+ */
+public enum DeferExpressionDimensions
+{
+  SINGLE_STRING("singleString") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      return false;
+    }
+  },
+
+  /**
+   * Defer expressions when their input variables are all fixed-width types (primitive numbers, or dictionary encoded).
+   */
+  FIXED_WIDTH("fixedWidth") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      if (isInnatelyDeferrable(plan, requiredBindingsList, inspector)) {
+        return false;
+      }
+
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities capabilities = inspector.getColumnCapabilities(requiredBinding);
+        if (capabilities == null) {
+          return false;
+        }
+
+        if (!capabilities.isNumeric() && !capabilities.isDictionaryEncoded().isTrue()) {
+          // Not fixed-width.
+          return false;
+        }
+      }
+
+      return true;
+    }
+  },
+
+  /**
+   * Defer expressions when their input variables are all fixed-width types (primitive numbers, or dictionary encoded).
+   */
+  FIXED_WIDTH_NON_NUMERIC("fixedWidthNonNumeric") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      if (isInnatelyDeferrable(plan, requiredBindingsList, inspector)) {
+        return false;
+      }
+
+      boolean allNumericInputs = true;
+
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities capabilities = inspector.getColumnCapabilities(requiredBinding);
+        if (capabilities == null) {
+          return false;
+        }
+
+        allNumericInputs = allNumericInputs && capabilities.isNumeric();
+
+        if (!capabilities.isNumeric() && !capabilities.isDictionaryEncoded().isTrue()) {

Review Comment:
   should this check `areDictionaryValuesUnique`?



##########
processing/src/main/java/org/apache/druid/query/groupby/DeferExpressionDimensions.java:
##########
@@ -0,0 +1,197 @@
+/*
+ * 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.groupby;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.druid.java.util.common.IAE;
+import org.apache.druid.math.expr.ExprType;
+import org.apache.druid.query.dimension.DimensionSpec;
+import org.apache.druid.segment.ColumnInspector;
+import org.apache.druid.segment.column.ColumnCapabilities;
+import org.apache.druid.segment.column.ValueType;
+import org.apache.druid.segment.vector.VectorColumnSelectorFactory;
+import org.apache.druid.segment.virtual.ExpressionPlan;
+import org.apache.druid.segment.virtual.ExpressionVirtualColumn;
+
+import java.util.List;
+
+/**
+ * Controls deferral of {@link ExpressionVirtualColumn} in {@link GroupByQuery}.
+ */
+public enum DeferExpressionDimensions
+{
+  SINGLE_STRING("singleString") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      return false;
+    }
+  },
+
+  /**
+   * Defer expressions when their input variables are all fixed-width types (primitive numbers, or dictionary encoded).
+   */
+  FIXED_WIDTH("fixedWidth") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      if (isInnatelyDeferrable(plan, requiredBindingsList, inspector)) {
+        return false;
+      }
+
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities capabilities = inspector.getColumnCapabilities(requiredBinding);
+        if (capabilities == null) {
+          return false;
+        }
+
+        if (!capabilities.isNumeric() && !capabilities.isDictionaryEncoded().isTrue()) {
+          // Not fixed-width.
+          return false;
+        }
+      }
+
+      return true;
+    }
+  },
+
+  /**
+   * Defer expressions when their input variables are all fixed-width types (primitive numbers, or dictionary encoded).
+   */
+  FIXED_WIDTH_NON_NUMERIC("fixedWidthNonNumeric") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      if (isInnatelyDeferrable(plan, requiredBindingsList, inspector)) {
+        return false;
+      }
+
+      boolean allNumericInputs = true;
+
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities capabilities = inspector.getColumnCapabilities(requiredBinding);
+        if (capabilities == null) {
+          return false;
+        }
+
+        allNumericInputs = allNumericInputs && capabilities.isNumeric();
+
+        if (!capabilities.isNumeric() && !capabilities.isDictionaryEncoded().isTrue()) {
+          // Not fixed-width.
+          return false;
+        }
+      }
+
+      return !allNumericInputs || (plan.getOutputType() != null && !plan.getOutputType().isNumeric());
+    }
+  },
+
+  ALWAYS("always") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      return !isInnatelyDeferrable(plan, requiredBindingsList, inspector);
+    }
+  };
+
+  public static final String JSON_KEY = "deferExpressionDimensions";
+
+  private final String jsonName;
+
+  DeferExpressionDimensions(String jsonName)
+  {
+    this.jsonName = jsonName;
+  }
+
+  @JsonCreator
+  public static DeferExpressionDimensions fromString(final String jsonName)
+  {
+    for (final DeferExpressionDimensions value : values()) {
+      if (value.jsonName.equals(jsonName)) {
+        return value;
+      }
+    }
+
+    throw new IAE("Invalid value[%s] for[%s]", jsonName, JSON_KEY);
+  }
+
+  public abstract boolean useDeferredGroupBySelector(
+      ExpressionPlan plan,
+      List<String> requiredBindingsList,
+      ColumnInspector inspector
+  );
+
+  @Override
+  @JsonValue
+  public String toString()
+  {
+    return jsonName;
+  }
+
+  /**
+   * Whether the given expression can be deferred innately by the selector created by
+   * {@link ExpressionVirtualColumn#makeSingleValueVectorDimensionSelector(DimensionSpec, VectorColumnSelectorFactory)}.
+   *
+   * In this case, all options for this enum return false from
+   * {@link #useDeferredGroupBySelector(ExpressionPlan, List, ColumnInspector)}, because there is no need to defer
+   * redundantly.
+   */
+  private static boolean isInnatelyDeferrable(
+      ExpressionPlan plan,
+      List<String> requiredBindingsList,
+      ColumnInspector inspector
+  )
+  {
+    if (plan.getOutputType() != null
+        && plan.getOutputType().is(ExprType.STRING)
+        && requiredBindingsList.size() <= 1) {
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities requiredBindingCapabilities = inspector.getColumnCapabilities(requiredBinding);
+
+        if (requiredBindingCapabilities == null
+            || !requiredBindingCapabilities.is(ValueType.STRING)
+            || !requiredBindingCapabilities.isDictionaryEncoded().isTrue()) {
+          return false;
+        }
+      }
+
+      return true;

Review Comment:
   does this also need to check `ColumnCapabilities.areDictionaryValuesUnique`?



##########
processing/src/main/java/org/apache/druid/query/groupby/DeferExpressionDimensions.java:
##########
@@ -0,0 +1,197 @@
+/*
+ * 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.groupby;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.druid.java.util.common.IAE;
+import org.apache.druid.math.expr.ExprType;
+import org.apache.druid.query.dimension.DimensionSpec;
+import org.apache.druid.segment.ColumnInspector;
+import org.apache.druid.segment.column.ColumnCapabilities;
+import org.apache.druid.segment.column.ValueType;
+import org.apache.druid.segment.vector.VectorColumnSelectorFactory;
+import org.apache.druid.segment.virtual.ExpressionPlan;
+import org.apache.druid.segment.virtual.ExpressionVirtualColumn;
+
+import java.util.List;
+
+/**
+ * Controls deferral of {@link ExpressionVirtualColumn} in {@link GroupByQuery}.
+ */
+public enum DeferExpressionDimensions
+{
+  SINGLE_STRING("singleString") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      return false;
+    }
+  },
+
+  /**
+   * Defer expressions when their input variables are all fixed-width types (primitive numbers, or dictionary encoded).
+   */
+  FIXED_WIDTH("fixedWidth") {
+    @Override
+    public boolean useDeferredGroupBySelector(
+        ExpressionPlan plan,
+        List<String> requiredBindingsList,
+        ColumnInspector inspector
+    )
+    {
+      if (isInnatelyDeferrable(plan, requiredBindingsList, inspector)) {
+        return false;
+      }
+
+      for (final String requiredBinding : requiredBindingsList) {
+        final ColumnCapabilities capabilities = inspector.getColumnCapabilities(requiredBinding);
+        if (capabilities == null) {
+          return false;
+        }
+
+        if (!capabilities.isNumeric() && !capabilities.isDictionaryEncoded().isTrue()) {

Review Comment:
   should this check `areDictionaryValuesUnique`? Technically it probably doesn't have to since i think the only things that set this to false while retaining `isDictionaryEncoded` as true are non-default dimension specs like extractionFn which are not 1:1, but also not supported for use with vectorization.
   
   Also someday i'd like to have a cooler way to detect fixed width types that works for complex too, but that can wait for a future change.



-- 
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: commits-unsubscribe@druid.apache.org

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


Re: [PR] Defer more expressions in vectorized groupBy. (druid)

Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #16338:
URL: https://github.com/apache/druid/pull/16338#discussion_r1596273161


##########
benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlExpressionBenchmark.java:
##########


Review Comment:
   There's also `SqlGroupByBenchmark` that benchmarks the code with various distributions and cardinalities. Maybe we should benchmark the code with the string columns and different parameters. 



-- 
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: commits-unsubscribe@druid.apache.org

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


Re: [PR] Defer more expressions in vectorized groupBy. (druid)

Posted by "gianm (via GitHub)" <gi...@apache.org>.
gianm commented on code in PR #16338:
URL: https://github.com/apache/druid/pull/16338#discussion_r1597308119


##########
benchmarks/src/test/java/org/apache/druid/benchmark/query/SqlExpressionBenchmark.java:
##########


Review Comment:
   Are you suggesting adding a new `@Benchmark` method to `SqlGroupByBenchmark` that uses a SQL query with expressions?



-- 
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: commits-unsubscribe@druid.apache.org

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