korlov42 commented on code in PR #6187: URL: https://github.com/apache/ignite-3/pull/6187#discussion_r2189945194
########## modules/runner/src/integrationTest/java/org/apache/ignite/internal/benchmark/SqlSelectAllBenchmark.java: ########## @@ -0,0 +1,161 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ignite.internal.benchmark; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.concurrent.TimeUnit; +import org.apache.ignite.internal.sql.engine.util.TpcTable; +import org.apache.ignite.internal.sql.engine.util.tpch.TpchTables; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; + +/** + * Benchmark that runs sql queries from TPC-H suite via embedded client. + */ +@State(Scope.Benchmark) +@Fork(1) +@Threads(1) +@Warmup(iterations = 10, time = 2) +@Measurement(iterations = 20, time = 2) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +@SuppressWarnings({"WeakerAccess", "unused"}) +public class SqlSelectAllBenchmark extends AbstractTpcBenchmark { + /* + Minimal configuration of this benchmark requires specifying pathToDataset. Latest known location + of dataset is https://github.com/cmu-db/benchbase/tree/main/data/tpch-sf0.01 for scale factor 0.01 + and https://github.com/cmu-db/benchbase/tree/main/data/tpch-sf0.1 for scale factor 0.1. Dataset + is set of CSV files with name `{$tableName}.tbl` per each table and character `|` as separator. + + By default, cluster's work directory will be created as a temporary folder. This implies, + that all data generated by benchmark will be cleared automatically. However, this also implies + that cluster will be recreated on EVERY RUN. Given there are 25 queries, it results in 25 schema + initialization and data upload cycles. To initialize cluster once and then reuse it state override + `AbstractMultiNodeBenchmark.workDir()` method. Don't forget to clear that directory afterwards. + */ + + @Override + TpcTable[] tablesToInit() { + return new TpcTable[] { TpchTables.LINEITEM }; + } + + @Override + protected Path workDir() throws Exception { + return Paths.get("/Users/amashenkov/w/ignite-3/modules/runner/work/"); + } + + @Override + protected int nodes() { + return 1; + } + + @Override + Path pathToDataset() { + return Paths.get("/Users/amashenkov/w/datasets/tpc-h/sf-0.1"); + } Review Comment: ```suggestion @Override Path pathToDataset() { throw new RuntimeException("Provide path to directory containing <table_name>.tbl files"); } ``` ########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueGetPlan.java: ########## @@ -201,16 +200,22 @@ private static class SimpleLookupExecution<RowT> extends Performable<RowT> { private final RowHandler<RowT> rowHandler; private final RowFactory<RowT> tableRowFactory; private final SqlRowProvider<RowT> keySupplier; - private final BitSet requiredColumns; + private final int[] requiredColumns; Review Comment: let's mark this as nullable, as well as param in constructor ########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/TableScanNode.java: ########## @@ -46,7 +46,7 @@ public class TableScanNode<RowT> extends StorageScanNode<RowT> { private final RowFactory<RowT> rowFactory; - private final @Nullable BitSet requiredColumns; + private final @Nullable int[] requiredColumns; Review Comment: ```suggestion private final int @Nullable [] requiredColumns; ``` ########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ScannableTableImpl.java: ########## @@ -56,7 +55,7 @@ public ScannableTableImpl(InternalTable internalTable, TableRowConverterFactory /** {@inheritDoc} */ @Override public <RowT> Publisher<RowT> scan(ExecutionContext<RowT> ctx, PartitionWithConsistencyToken partWithConsistencyToken, - RowFactory<RowT> rowFactory, @Nullable BitSet requiredColumns) { + RowFactory<RowT> rowFactory, int[] requiredColumns) { Review Comment: nullable ########## modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/rel/ProjectableFilterableTableScan.java: ########## @@ -66,7 +66,7 @@ public abstract class ProjectableFilterableTableScan extends TableScan { protected final @Nullable List<String> names; /** Participating columns. */ - protected final ImmutableBitSet requiredColumns; + protected final ImmutableIntList requiredColumns; Review Comment: nullable here and below -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org