github-advanced-security[bot] commented on code in PR #16533: URL: https://github.com/apache/druid/pull/16533#discussion_r1695771857
########## processing/src/main/java/org/apache/druid/segment/StorageAdapter.java: ########## @@ -35,6 +37,59 @@ @PublicApi public interface StorageAdapter extends CursorFactory, ColumnInspector { + + /** + * Build a {@link CursorMaker} which can provide {@link Cursor} and {@link VectorCursor} (if capable) which allows + * scanning segments and creating {@link ColumnSelectorFactory} and + * {@link org.apache.druid.segment.vector.VectorColumnSelectorFactory} respectively to read row values. + */ + @Override + default CursorMaker asCursorMaker(CursorBuildSpec spec) + { + return new CursorMaker() + { + @Override + public boolean canVectorize() + { + return StorageAdapter.this.canVectorize(spec.getFilter(), spec.getVirtualColumns(), spec.isDescending()); + } + + @Override + public Cursor makeCursor() + { + return Iterables.getOnlyElement( + StorageAdapter.this.makeCursors( + spec.getFilter(), + spec.getInterval(), + spec.getVirtualColumns(), + Granularities.ALL, + spec.isDescending(), + spec.getQueryMetrics() + ).toList() Review Comment: ## Deprecated method or constructor invocation Invoking [CursorFactory.makeCursors](1) should be avoided because it has been deprecated. [Show more details](https://github.com/apache/druid/security/code-scanning/7633) ########## processing/src/main/java/org/apache/druid/segment/StorageAdapter.java: ########## @@ -35,6 +37,59 @@ @PublicApi public interface StorageAdapter extends CursorFactory, ColumnInspector { + + /** + * Build a {@link CursorMaker} which can provide {@link Cursor} and {@link VectorCursor} (if capable) which allows + * scanning segments and creating {@link ColumnSelectorFactory} and + * {@link org.apache.druid.segment.vector.VectorColumnSelectorFactory} respectively to read row values. + */ + @Override + default CursorMaker asCursorMaker(CursorBuildSpec spec) + { + return new CursorMaker() + { + @Override + public boolean canVectorize() + { + return StorageAdapter.this.canVectorize(spec.getFilter(), spec.getVirtualColumns(), spec.isDescending()); Review Comment: ## Deprecated method or constructor invocation Invoking [CursorFactory.canVectorize](1) should be avoided because it has been deprecated. [Show more details](https://github.com/apache/druid/security/code-scanning/7632) ########## processing/src/main/java/org/apache/druid/segment/StorageAdapter.java: ########## @@ -35,6 +37,59 @@ @PublicApi public interface StorageAdapter extends CursorFactory, ColumnInspector { + + /** + * Build a {@link CursorMaker} which can provide {@link Cursor} and {@link VectorCursor} (if capable) which allows + * scanning segments and creating {@link ColumnSelectorFactory} and + * {@link org.apache.druid.segment.vector.VectorColumnSelectorFactory} respectively to read row values. + */ + @Override + default CursorMaker asCursorMaker(CursorBuildSpec spec) + { + return new CursorMaker() + { + @Override + public boolean canVectorize() + { + return StorageAdapter.this.canVectorize(spec.getFilter(), spec.getVirtualColumns(), spec.isDescending()); + } + + @Override + public Cursor makeCursor() + { + return Iterables.getOnlyElement( + StorageAdapter.this.makeCursors( + spec.getFilter(), + spec.getInterval(), + spec.getVirtualColumns(), + Granularities.ALL, + spec.isDescending(), + spec.getQueryMetrics() + ).toList() + ); + } + + @Override + public VectorCursor makeVectorCursor() + { + return StorageAdapter.this.makeVectorCursor( + spec.getFilter(), + spec.getInterval(), + spec.getVirtualColumns(), + spec.isDescending(), + spec.getQueryContext().getVectorSize(), + spec.getQueryMetrics() + ); Review Comment: ## Deprecated method or constructor invocation Invoking [CursorFactory.makeVectorCursor](1) should be avoided because it has been deprecated. [Show more details](https://github.com/apache/druid/security/code-scanning/7634) -- 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-unsubscr...@druid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org