File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
main/java/org/elasticsearch/xpack/esql/inference
test/java/org/elasticsearch/xpack/esql/inference Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 1414import org .elasticsearch .compute .data .BytesRefBlock ;
1515import org .elasticsearch .compute .data .Page ;
1616import org .elasticsearch .compute .operator .DriverContext ;
17- import org .elasticsearch .compute .operator .EvalOperator ;
1817import org .elasticsearch .compute .operator .EvalOperator .ExpressionEvaluator ;
1918import org .elasticsearch .core .Releasables ;
2019import org .elasticsearch .xcontent .ToXContent ;
3130import java .util .Map ;
3231import java .util .stream .Collectors ;
3332
34-
3533/**
3634 * Encodes rows into an XContent format (JSON,YAML,...) for further processing.
3735 * Extracted columns can be specified using {@link ExpressionEvaluator}
@@ -141,10 +139,7 @@ private ColumnInfoImpl[] columnsInfo() {
141139 }
142140
143141 private ExpressionEvaluator [] fieldsValueEvaluators (DriverContext context ) {
144- return fieldsEvaluatorFactories .values ()
145- .stream ()
146- .map (factory -> factory .get (context ))
147- .toArray (ExpressionEvaluator []::new );
142+ return fieldsEvaluatorFactories .values ().stream ().map (factory -> factory .get (context )).toArray (ExpressionEvaluator []::new );
148143 }
149144 }
150145}
Original file line number Diff line number Diff line change @@ -237,17 +237,15 @@ private XContentRowEncoder.Factory mockRowEncoderFactory() {
237237 doAnswer (factoryInvocation -> {
238238 DriverContext driverContext = factoryInvocation .getArgument (0 , DriverContext .class );
239239 XContentRowEncoder rowEncoder = mock (XContentRowEncoder .class );
240- doAnswer (
241- encoderInvocation -> {
242- Page inputPage = encoderInvocation .getArgument (0 , Page .class );
243- return driverContext .blockFactory ().newConstantBytesRefBlockWith (new BytesRef (randomRealisticUnicodeOfCodepointLength (4 )), inputPage .getPositionCount ());
244- }
245- ).when (rowEncoder ).eval (any (Page .class ));
240+ doAnswer (encoderInvocation -> {
241+ Page inputPage = encoderInvocation .getArgument (0 , Page .class );
242+ return driverContext .blockFactory ()
243+ .newConstantBytesRefBlockWith (new BytesRef (randomRealisticUnicodeOfCodepointLength (4 )), inputPage .getPositionCount ());
244+ }).when (rowEncoder ).eval (any (Page .class ));
246245
247246 return rowEncoder ;
248247 }).when (factory ).get (any (DriverContext .class ));
249248
250-
251249 return factory ;
252250 }
253251
You can’t perform that action at this time.
0 commit comments