github-advanced-security[bot] commented on code in PR #18521:
URL: https://github.com/apache/druid/pull/18521#discussion_r2361360881


##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -129,11 +192,38 @@
   }
 
   /**
-   * Build a {@link SingleValueDimensionVectorSelector} corresponding to this 
virtual column. Also provides the name
-   * that the virtual column was referenced with (through {@link 
DimensionSpec#getDimension()}, which is useful if this
-   * column uses dot notation. The virtual column is expected to apply any 
necessary decoration from the
-   * {@link DimensionSpec}.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param dimensionSpec  spec the column was referenced with. Also provides 
the name that the
+   *                       virtual column was referenced with, which is useful 
if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns.
+   * @param offset         offset to use with underlying columns.
    */
+  default SingleValueDimensionVectorSelector 
makeSingleValueVectorDimensionSelector(
+      DimensionSpec dimensionSpec,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final SingleValueDimensionVectorSelector selector =
+        makeSingleValueVectorDimensionSelector(dimensionSpec, columnSelector, 
offset);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeSingleValueVectorDimensionSelector](1) should be 
avoided because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10348)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -221,23 +353,47 @@
   }
 
   /**
-   * Build a {@link VectorObjectSelector} corresponding to this virtual 
column. Also provides the name that the
-   * virtual column was referenced with, which is useful if this column uses 
dot notation.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param columnName     name the column was referenced with, which is 
useful if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns, if 
available. Generally only available for
+   *                       regular segments.
+   * @param offset         offset to use with underlying columns. Available 
only if columnSelector is available.
    */
+  default VectorObjectSelector makeVectorObjectSelector(
+      String columnName,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final VectorObjectSelector selector = makeVectorObjectSelector(columnName, 
columnSelector, offset);
+    if (selector != null) {
+      return selector;
+    } else {
+      return makeVectorObjectSelector(columnName, factory);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeVectorObjectSelector](1) should be avoided 
because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10355)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -161,11 +247,39 @@
   }
 
   /**
-   * Build a {@link MultiValueDimensionVectorSelector} corresponding to this 
virtual column. Also provides
-   * the name that the virtual column was referenced with (through {@link 
DimensionSpec#getDimension()}, which is useful
-   * if this column uses dot notation. The virtual column is expected to apply 
any necessary decoration from the
-   * {@link DimensionSpec}.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param dimensionSpec  spec the column was referenced with. Also provides 
the name that the
+   *                       virtual column was referenced with, which is useful 
if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns, if 
available. Generally only available for
+   *                       regular segments.
+   * @param offset         offset to use with underlying columns. Available 
only if columnSelector is available.
+   */
+  default MultiValueDimensionVectorSelector 
makeMultiValueVectorDimensionSelector(
+      DimensionSpec dimensionSpec,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final MultiValueDimensionVectorSelector selector =
+        makeMultiValueVectorDimensionSelector(dimensionSpec, columnSelector, 
offset);
+    if (selector != null) {
+      return selector;
+    } else {
+      return makeMultiValueVectorDimensionSelector(dimensionSpec, factory);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeMultiValueVectorDimensionSelector](1) should be 
avoided because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10351)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -129,11 +192,38 @@
   }
 
   /**
-   * Build a {@link SingleValueDimensionVectorSelector} corresponding to this 
virtual column. Also provides the name
-   * that the virtual column was referenced with (through {@link 
DimensionSpec#getDimension()}, which is useful if this
-   * column uses dot notation. The virtual column is expected to apply any 
necessary decoration from the
-   * {@link DimensionSpec}.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param dimensionSpec  spec the column was referenced with. Also provides 
the name that the
+   *                       virtual column was referenced with, which is useful 
if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns.
+   * @param offset         offset to use with underlying columns.
    */
+  default SingleValueDimensionVectorSelector 
makeSingleValueVectorDimensionSelector(
+      DimensionSpec dimensionSpec,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final SingleValueDimensionVectorSelector selector =
+        makeSingleValueVectorDimensionSelector(dimensionSpec, columnSelector, 
offset);
+    if (selector != null) {
+      return selector;
+    } else {
+      return makeSingleValueVectorDimensionSelector(dimensionSpec, factory);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeSingleValueVectorDimensionSelector](1) should be 
avoided because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10349)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -161,11 +247,39 @@
   }
 
   /**
-   * Build a {@link MultiValueDimensionVectorSelector} corresponding to this 
virtual column. Also provides
-   * the name that the virtual column was referenced with (through {@link 
DimensionSpec#getDimension()}, which is useful
-   * if this column uses dot notation. The virtual column is expected to apply 
any necessary decoration from the
-   * {@link DimensionSpec}.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param dimensionSpec  spec the column was referenced with. Also provides 
the name that the
+   *                       virtual column was referenced with, which is useful 
if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns, if 
available. Generally only available for
+   *                       regular segments.
+   * @param offset         offset to use with underlying columns. Available 
only if columnSelector is available.
+   */
+  default MultiValueDimensionVectorSelector 
makeMultiValueVectorDimensionSelector(
+      DimensionSpec dimensionSpec,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final MultiValueDimensionVectorSelector selector =
+        makeMultiValueVectorDimensionSelector(dimensionSpec, columnSelector, 
offset);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeMultiValueVectorDimensionSelector](1) should be 
avoided because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10350)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -221,23 +353,47 @@
   }
 
   /**
-   * Build a {@link VectorObjectSelector} corresponding to this virtual 
column. Also provides the name that the
-   * virtual column was referenced with, which is useful if this column uses 
dot notation.
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param columnName     name the column was referenced with, which is 
useful if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns, if 
available. Generally only available for
+   *                       regular segments.
+   * @param offset         offset to use with underlying columns. Available 
only if columnSelector is available.
    */
+  default VectorObjectSelector makeVectorObjectSelector(
+      String columnName,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final VectorObjectSelector selector = makeVectorObjectSelector(columnName, 
columnSelector, offset);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeVectorObjectSelector](1) should be avoided 
because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10354)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -192,25 +302,47 @@
     return null;
   }
 
+  /**
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param columnName     name the column was referenced with, which is 
useful if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns.
+   * @param offset         offset to use with underlying columns.
+   */
+  default VectorValueSelector makeVectorValueSelector(
+      String columnName,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final VectorValueSelector selector = makeVectorValueSelector(columnName, 
columnSelector, offset);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeVectorValueSelector](1) should be avoided 
because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10352)



##########
processing/src/main/java/org/apache/druid/segment/VirtualColumn.java:
##########
@@ -192,25 +302,47 @@
     return null;
   }
 
+  /**
+   * Build a selector corresponding to this virtual column.
+   *
+   * The virtual column is expected to apply any necessary {@link 
DimensionSpec#decorate(DimensionSelector)} or
+   * {@link DimensionSpec#getExtractionFn()} from the dimensionSpec.
+   *
+   * @param columnName     name the column was referenced with, which is 
useful if this column uses dot notation.
+   * @param factory        object for fetching underlying selectors.
+   * @param columnSelector object for fetching underlying columns.
+   * @param offset         offset to use with underlying columns.
+   */
+  default VectorValueSelector makeVectorValueSelector(
+      String columnName,
+      VectorColumnSelectorFactory factory,
+      ColumnSelector columnSelector,
+      ReadableVectorOffset offset
+  )
+  {
+    // Implementation for backwards compatibility with existing extensions.
+    final VectorValueSelector selector = makeVectorValueSelector(columnName, 
columnSelector, offset);
+    if (selector != null) {
+      return selector;
+    } else {
+      return makeVectorValueSelector(columnName, factory);

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [VirtualColumn.makeVectorValueSelector](1) should be avoided 
because it has been deprecated.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10353)



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

Reply via email to