clintropolis commented on code in PR #16533:
URL: https://github.com/apache/druid/pull/16533#discussion_r1627197171
##########
processing/src/main/java/org/apache/druid/segment/CursorFactory.java:
##########
@@ -35,12 +38,55 @@
*/
public interface CursorFactory
{
+ default CursorMaker asCursorMaker(CursorBuildSpec spec)
+ {
+
+ return new CursorMaker()
+ {
+ @Override
+ public boolean canVectorize()
+ {
+ return CursorFactory.this.canVectorize(spec.getFilter(),
spec.getVirtualColumns(), spec.isDescending());
+ }
+
+ @Override
+ public Sequence<Cursor> makeCursors()
+ {
+ return CursorFactory.this.makeCursors(
+ spec.getFilter(),
+ spec.getInterval(),
+ spec.getVirtualColumns(),
+ spec.getGranularity(),
+ spec.isDescending(),
+ spec.getQueryMetrics()
+ );
Review Comment:
this is intended so that existing `CursorFactory`/`StorageAdapter`
implementations can keep working with query engines without implementing
`asCursorMaker`
##########
processing/src/main/java/org/apache/druid/segment/CursorFactory.java:
##########
@@ -35,12 +38,55 @@
*/
public interface CursorFactory
{
+ default CursorMaker asCursorMaker(CursorBuildSpec spec)
+ {
+
+ return new CursorMaker()
+ {
+ @Override
+ public boolean canVectorize()
+ {
+ return CursorFactory.this.canVectorize(spec.getFilter(),
spec.getVirtualColumns(), spec.isDescending());
+ }
+
+ @Override
+ public Sequence<Cursor> makeCursors()
+ {
+ return CursorFactory.this.makeCursors(
+ spec.getFilter(),
+ spec.getInterval(),
+ spec.getVirtualColumns(),
+ spec.getGranularity(),
+ spec.isDescending(),
+ spec.getQueryMetrics()
+ );
+ }
+
+ @Override
+ public VectorCursor makeVectorCursor()
+ {
+ return CursorFactory.this.makeVectorCursor(
+ spec.getFilter(),
+ spec.getInterval(),
+ spec.getVirtualColumns(),
+ spec.isDescending(),
+ spec.getQueryContext().getVectorSize(),
+ spec.getQueryMetrics()
+ );
Review Comment:
this is intended so that existing `CursorFactory`/`StorageAdapter`
implementations can keep working with query engines without implementing
`asCursorMaker`
--
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]