Skip to content

Commit

Permalink
Bug fix for CREATE VIEW cases (which also load view metadata, but the…
Browse files Browse the repository at this point in the history
…re is no PreparedQuery)
  • Loading branch information
jepett0 committed Feb 16, 2024
1 parent 02df54f commit e811371
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ydb/core/kqp/provider/yql_kikimr_datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ class TKiSourceLoadTableMetadataTransformer : public TGraphTransformerBase {
return TStatus::Error;
}

if (res.Metadata->Kind == EKikimrTableKind::View) {
if (const auto& preparingQuery = SessionCtx->Query().PreparingQuery;
preparingQuery
&& res.Metadata->Kind == EKikimrTableKind::View
) {
const auto& viewMetadata = *res.Metadata;
const auto& preparingQuery = SessionCtx->Query().PreparingQuery;
YQL_ENSURE(preparingQuery);
auto* viewInfo = preparingQuery->MutablePhysicalQuery()->MutableViewsInfo()->Add();
auto* pathId = viewInfo->MutableTableId();
pathId->SetOwnerId(viewMetadata.PathId.OwnerId());
Expand Down

0 comments on commit e811371

Please sign in to comment.