Skip to content

Commit

Permalink
Merge PR #10741, #10799, #10732
Browse files Browse the repository at this point in the history
\#10732 Fix a bug in YQL node creation for indexImplTable table settings

\#10799support computation graph invalidation in purecalc

\#10741Don't use Now() during replay for yt settings
commit_hash:bc4c150ceb2ae05fc19eaa4804fb668730a89410
  • Loading branch information
aneporada committed Nov 12, 2024
1 parent 0f8074b commit c24e1e1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ Y_UNIT_TEST_SUITE(TYqlExtractPredicate) {
auto ytGateway = CreateYtFileGateway(yqlNativeServices);
typesCtx = MakeIntrusive<TTypeAnnotationContext>();
typesCtx->RandomProvider = CreateDeterministicRandomProvider(1);
auto ytState = MakeIntrusive<TYtState>();
auto ytState = MakeIntrusive<TYtState>(typesCtx.Get());
ytState->Gateway = ytGateway;
ytState->Types = typesCtx.Get();

InitializeYtGateway(ytGateway, ytState);
typesCtx->AddDataSink(YtProviderName, CreateYtDataSink(ytState));
Expand Down
5 changes: 5 additions & 0 deletions yql/essentials/core/facade/yql_facade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ TProgram::TProgram(
QContext_.GetWriter()->Put({FacadeComponent, StaticCredentialsLabel}, credList).GetValueSync();
} else if (QContext_.CanRead()) {
Credentials_ = MakeIntrusive<TCredentials>();
Credentials_->SetUserCredentials({
.OauthToken = "REPLAY_OAUTH",
.BlackboxSessionIdCookie = "REPLAY_SESSIONID"
});

for (const auto& label : {StaticCredentialsLabel, DynamicCredentialsLabel}) {
auto item = QContext_.GetReader()->Get({FacadeComponent, label}).GetValueSync();
if (item) {
Expand Down
3 changes: 1 addition & 2 deletions yql/essentials/core/ut/yql_expr_constraint_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ Y_UNIT_TEST_SUITE(TYqlExprConstraints) {
auto ytGateway = CreateYtFileGateway(yqlNativeServices);
auto typeAnnotationContext = MakeIntrusive<TTypeAnnotationContext>();
typeAnnotationContext->RandomProvider = CreateDeterministicRandomProvider(1);
auto ytState = MakeIntrusive<TYtState>();
auto ytState = MakeIntrusive<TYtState>(typeAnnotationContext.Get());
ytState->Gateway = ytGateway;
ytState->Types = typeAnnotationContext.Get();

InitializeYtGateway(ytGateway, ytState);
typeAnnotationContext->AddDataSink(YtProviderName, CreateYtDataSink(ytState));
Expand Down
3 changes: 1 addition & 2 deletions yql/essentials/core/ut/yql_expr_discover_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ Y_UNIT_TEST_SUITE(TDiscoverYqlExpr) {
auto ytGateway = CreateYtFileGateway(yqlNativeServices);
auto typeAnnotationContext = MakeIntrusive<TTypeAnnotationContext>();
typeAnnotationContext->DiscoveryMode = true;
auto ytState = MakeIntrusive<TYtState>();
auto ytState = MakeIntrusive<TYtState>(typeAnnotationContext.Get());
ytState->Gateway = ytGateway;
ytState->Types = typeAnnotationContext.Get();

InitializeYtGateway(ytGateway, ytState);
auto randomProvider = CreateDeterministicRandomProvider(1);
Expand Down
3 changes: 1 addition & 2 deletions yql/essentials/core/ut/yql_expr_optimize_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,8 @@ Y_UNIT_TEST_SUITE(TOptimizeYqlExpr) {
auto yqlNativeServices = NFile::TYtFileServices::Make(functionRegistry.Get(), testTables);
auto ytGateway = CreateYtFileGateway(yqlNativeServices);
auto typeAnnotationContext = MakeIntrusive<TTypeAnnotationContext>();
auto ytState = MakeIntrusive<TYtState>();
auto ytState = MakeIntrusive<TYtState>(typeAnnotationContext.Get());
ytState->Gateway = ytGateway;
ytState->Types = typeAnnotationContext.Get();

InitializeYtGateway(ytGateway, ytState);
auto randomProvider = CreateDeterministicRandomProvider(1);
Expand Down
3 changes: 1 addition & 2 deletions yql/essentials/core/ut/yql_expr_providers_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ Y_UNIT_TEST_SUITE(TCompileWithProvidersYqlExpr) {
auto yqlNativeServices = NFile::TYtFileServices::Make(functionRegistry.Get(), testTables);
auto ytGateway = CreateYtFileGateway(yqlNativeServices);
auto typeAnnotationContext = MakeIntrusive<TTypeAnnotationContext>();
auto ytState = MakeIntrusive<TYtState>();
auto ytState = MakeIntrusive<TYtState>(typeAnnotationContext.Get());
ytState->Gateway = ytGateway;
ytState->Types = typeAnnotationContext.Get();

InitializeYtGateway(ytGateway, ytState);
typeAnnotationContext->AddDataSink(YtProviderName, CreateYtDataSink(ytState));
Expand Down
7 changes: 5 additions & 2 deletions yql/essentials/providers/common/provider/yql_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,15 @@ std::pair<IGraphTransformer::TStatus, TAsyncTransformCallbackFuture> FreezeUsedF
return SyncError();
}

if (types.QContext.CanRead()) {
return SyncOk();
}

auto future = FreezeUserDataTableIfNeeded(types.UserDataStorage, files, urlDownloadFilter);
if (future.Wait(TDuration::Zero())) {
files = future.GetValue()();
return SyncOk();
}
else {
} else {
return std::make_pair(IGraphTransformer::TStatus::Async, future.Apply(
[](const NThreading::TFuture<std::function<TUserDataTable()>>& completedFuture) {
return TAsyncTransformCallback([completedFuture](const TExprNode::TPtr& input, TExprNode::TPtr& output, TExprContext& ctx) {
Expand Down
4 changes: 2 additions & 2 deletions yql/essentials/sql/v1/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ static INode::TPtr CreateIndexDesc(const TIndexDescription& index, ETableSetting
node.Q(node.Y(node.Q("dataColumns"), node.Q(dataColumns)))
);
if (index.TableSettings.IsSet()) {
const auto& tableSettings = node.Y(
const auto& tableSettings = node.Q(node.Y(
node.Q("tableSettings"),
node.Q(CreateTableSettings(index.TableSettings, parsingMode, node))
);
));
indexNode = node.L(indexNode, tableSettings);
}
if (const auto* indexSettingsPtr = std::get_if<TVectorIndexSettings>(&index.IndexSettings)) {
Expand Down

0 comments on commit c24e1e1

Please sign in to comment.