(DependencyCarrier executor,
PlannerContext plannerContext,
Set<PlanHint> hints,
ProjectionBuilder projectionBuilder,
int limit,
int offset,
@Nullable OrderBy order,
@Nullable Integer pageSizeHint,
Row params,
SubQueryResults subQueryResults)
| 108 | } |
| 109 | |
| 110 | @Override |
| 111 | public ExecutionPlan build(DependencyCarrier executor, |
| 112 | PlannerContext plannerContext, |
| 113 | Set<PlanHint> hints, |
| 114 | ProjectionBuilder projectionBuilder, |
| 115 | int limit, |
| 116 | int offset, |
| 117 | @Nullable OrderBy order, |
| 118 | @Nullable Integer pageSizeHint, |
| 119 | Row params, |
| 120 | SubQueryResults subQueryResults) { |
| 121 | plannerContext.newReaderAllocations(); |
| 122 | var executionPlan = Merge.ensureOnHandler( |
| 123 | source.build( |
| 124 | executor, |
| 125 | plannerContext, |
| 126 | hints, |
| 127 | projectionBuilder, |
| 128 | limit, |
| 129 | offset, |
| 130 | order, |
| 131 | pageSizeHint, |
| 132 | params, |
| 133 | subQueryResults |
| 134 | ), |
| 135 | plannerContext |
| 136 | ); |
| 137 | ReaderAllocations readerAllocations = plannerContext.buildReaderAllocations(); |
| 138 | UnaryOperator<Symbol> paramBinder = new SubQueryAndParamBinder(params, subQueryResults); |
| 139 | FetchPhase fetchPhase = new FetchPhase( |
| 140 | plannerContext.nextExecutionPhaseId(), |
| 141 | readerAllocations.nodeReaders().keySet(), |
| 142 | readerAllocations.bases(), |
| 143 | readerAllocations.tableIndices(), |
| 144 | fetchRefs |
| 145 | ); |
| 146 | |
| 147 | ArrayList<Symbol> boundOutputs = new ArrayList<>(replacedOutputs.size()); |
| 148 | for (var entry : replacedOutputs.entrySet()) { |
| 149 | Symbol key = entry.getKey(); |
| 150 | Symbol value = entry.getValue(); |
| 151 | if (source.outputs().contains(key)) { |
| 152 | boundOutputs.add(paramBinder.apply(key)); |
| 153 | } else { |
| 154 | boundOutputs.add(paramBinder.apply(value)); |
| 155 | } |
| 156 | } |
| 157 | List<DataType<?>> inputTypes = Symbols.typeView(source.outputs()); |
| 158 | // Must bind source outputs to ensure InputColumns.create can associate parameters. Example: |
| 159 | // boundOutputs: [FetchStub<_doc['name']>, Function(ints + 1)] |
| 160 | // source.outputs(): [FetchMarker<_fetchid>, Function(ints + $1)] |
| 161 | // boundedSourceOutputs: [FetchMarker<_fetchid>, Function(ints + 1)] |
| 162 | List<Symbol> boundSourceOutputs = Lists.map(source.outputs(), paramBinder); |
| 163 | List<Symbol> fetchOutputs = InputColumns.create(boundOutputs, new InputColumns.SourceSymbols(boundSourceOutputs)); |
| 164 | FetchProjection fetchProjection = new FetchProjection( |
| 165 | fetchPhase.phaseId(), |
| 166 | plannerContext.fetchSize(), |
| 167 | fetchSourceByRelation, |
nothing calls this directly
no test coverage detected