Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nik9000 committed Oct 3, 2023
1 parent 240d39c commit f6f74d1
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 9 deletions.
3 changes: 3 additions & 0 deletions distribution/src/config/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ appender.rolling_old.strategy.action.condition.nested_condition.type = IfAccumul
appender.rolling_old.strategy.action.condition.nested_condition.exceeds = 2GB
################################################

logger.esql.name = org.elasticsearch.xpack.esql
logger.esql.level = trace

rootLogger.level = info
rootLogger.appenderRef.console.ref = console
rootLogger.appenderRef.rolling.ref = rolling
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/case.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/coalesce.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/concat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/date_parse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/greatest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/esql/functions/signature/least.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@ protected Page process(Page page) {
var block = page.getBlock(source);
blocks[b++] = block;
}
// iterate the blocks to see which one isn't used
closeUnused(page, blocks);
return new Page(page.getPositionCount(), blocks);
}

/**
* Close all {@link Block}s that are in {@code page} but are not in {@code blocks}.
*/
public static void closeUnused(Page page, Block[] blocks) {
List<Releasable> blocksToRelease = new ArrayList<>();

for (int i = 0; i < blockCount; i++) {
for (int i = 0; i < page.getBlockCount(); i++) {
boolean used = false;
var current = page.getBlock(i);
for (int j = 0; j < blocks.length; j++) {
Expand All @@ -87,7 +94,6 @@ protected Page process(Page page) {
}
}
Releasables.close(blocksToRelease);
return new Page(page.getPositionCount(), blocks);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import org.elasticsearch.test.ListMatcher;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xcontent.json.JsonXContent;
import org.elasticsearch.xpack.esql.qa.rest.EsqlSpecTestCase;
import org.junit.After;
import org.junit.Before;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -264,4 +267,10 @@ private void initIndex(String name, String bulk) throws IOException {
equalTo("{\"_shards\":{\"total\":2,\"successful\":1,\"failed\":0}}")
);
}

@Before
@After
public void assertRequestBreakerEmpty() throws Exception {
EsqlSpecTestCase.assertRequestBreakerEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.elasticsearch.compute.operator.Operator;
import org.elasticsearch.compute.operator.Operator.OperatorFactory;
import org.elasticsearch.compute.operator.OutputOperator.OutputOperatorFactory;
import org.elasticsearch.compute.operator.ProjectOperator;
import org.elasticsearch.compute.operator.RowOperator.RowOperatorFactory;
import org.elasticsearch.compute.operator.ShowOperator;
import org.elasticsearch.compute.operator.SinkOperator;
Expand Down Expand Up @@ -333,6 +334,7 @@ private static Function<Page, Page> alignPageToAttributes(List<Attribute> attrs,
for (int i = 0; i < blocks.length; i++) {
blocks[i] = p.getBlock(mappedPosition[i]);
}
ProjectOperator.closeUnused(p, blocks);
return new Page(blocks);
} : Function.identity();

Expand Down

0 comments on commit f6f74d1

Please sign in to comment.