Skip to content

Commit bf8e3da

Browse files
author
dtorilov
committed
YT-26180: Add optimization level option
commit_hash:db18c78c543df7c113c96252143bfd877f57e215
1 parent 521f965 commit bf8e3da

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

yt/yt/client/api/client_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ struct TSelectRowsOptions
182182
NYson::TYsonString PlaceholderValues;
183183
//! Native or WebAssembly execution backend.
184184
std::optional<NCodegen::EExecutionBackend> ExecutionBackend;
185+
//! JIT optimization level hint.
186+
std::optional<NCodegen::EOptimizationLevel> OptimizationLevel;
185187
//! Explicitly allow or forbid the usage of row cache.
186188
std::optional<bool> UseLookupCache;
187189
//! Tune batch sizes for row processing.

yt/yt/client/api/rpc_proxy/client_base.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ TFuture<TSelectRowsResult> TClientBase::SelectRows(
11111111
req->set_verbose_logging(options.VerboseLogging);
11121112
req->set_new_range_inference(options.NewRangeInference);
11131113
YT_OPTIONAL_SET_PROTO(req, execution_backend, options.ExecutionBackend);
1114+
YT_OPTIONAL_SET_PROTO(req, optimization_level, options.OptimizationLevel);
11141115
req->set_enable_code_cache(options.EnableCodeCache);
11151116
req->set_memory_limit_per_node(options.MemoryLimitPerNode);
11161117
ToProto(req->mutable_suppressable_access_tracking_options(), options);

yt/yt/client/driver/table_commands.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,13 @@ void TSelectRowsCommand::Register(TRegistrar registrar)
909909
})
910910
.Optional(/*init*/ false);
911911

912+
registrar.ParameterWithUniversalAccessor<std::optional<EOptimizationLevel>>(
913+
"optimization_level",
914+
[] (TThis* command) -> auto& {
915+
return command->Options.OptimizationLevel;
916+
})
917+
.Optional(/*init*/ false);
918+
912919
registrar.ParameterWithUniversalAccessor<TVersionedReadOptions>(
913920
"versioned_read_options",
914921
[] (TThis* command) -> auto& {

yt/yt/library/codegen_api/execution_backend.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ DEFINE_ENUM(EExecutionBackend,
1111
(WebAssembly)
1212
);
1313

14+
DEFINE_ENUM(EOptimizationLevel,
15+
(None)
16+
(Default)
17+
);
18+
1419
////////////////////////////////////////////////////////////////////////////////
1520

1621
} // namespace NYT::NCodegen

yt/yt_proto/yt/client/api/rpc_proxy/proto/api_service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ message TReqSelectRows
712712
optional int64 max_join_batch_size = 31;
713713
optional bool use_order_by_in_join_subqueries = 32;
714714
optional int32 statistics_aggregation = 33; // EStatisticsAggregation
715+
optional int32 optimization_level = 35; // EOptimizationLevel
715716

716717
optional TSuppressableAccessTrackingOptions suppressable_access_tracking_options = 104;
717718

0 commit comments

Comments
 (0)