@@ -517,6 +517,47 @@ void TKqpTasksGraph::BuildVectorResolveChannels(const TStageInfo& stageInfo, ui3
517
517
inputStageInfo, outputIndex, enableSpilling, logFunc);
518
518
}
519
519
520
+ void TKqpTasksGraph::BuildDqSourceStreamLookupChannels (const TStageInfo& stageInfo, ui32 inputIndex, const TStageInfo& inputStageInfo,
521
+ ui32 outputIndex, const NKqpProto::TKqpPhyCnDqSourceStreamLookup& dqSourceStreamLookup, const TChannelLogFunc& logFunc) {
522
+ YQL_ENSURE (stageInfo.Tasks .size () == 1 );
523
+
524
+ auto * settings = GetMeta ().Allocate <NDqProto::TDqInputTransformLookupSettings>();
525
+ settings->SetLeftLabel (dqSourceStreamLookup.GetLeftLabel ());
526
+ settings->SetRightLabel (dqSourceStreamLookup.GetRightLabel ());
527
+ settings->SetJoinType (dqSourceStreamLookup.GetJoinType ());
528
+ settings->SetNarrowInputRowType (dqSourceStreamLookup.GetConnectionInputRowType ());
529
+ settings->SetNarrowOutputRowType (dqSourceStreamLookup.GetConnectionOutputRowType ());
530
+ settings->SetCacheLimit (dqSourceStreamLookup.GetCacheLimit ());
531
+ settings->SetCacheTtlSeconds (dqSourceStreamLookup.GetCacheTtlSeconds ());
532
+ settings->SetMaxDelayedRows (dqSourceStreamLookup.GetMaxDelayedRows ());
533
+ settings->SetIsMultiget (dqSourceStreamLookup.GetIsMultiGet ());
534
+
535
+ const auto & leftJointKeys = dqSourceStreamLookup.GetLeftJoinKeyNames ();
536
+ settings->MutableLeftJoinKeyNames ()->Assign (leftJointKeys.begin (), leftJointKeys.end ());
537
+
538
+ const auto & rightJointKeys = dqSourceStreamLookup.GetRightJoinKeyNames ();
539
+ settings->MutableRightJoinKeyNames ()->Assign (rightJointKeys.begin (), rightJointKeys.end ());
540
+
541
+ auto & streamLookupSource = *settings->MutableRightSource ();
542
+ streamLookupSource.SetSerializedRowType (dqSourceStreamLookup.GetLookupRowType ());
543
+ const auto & compiledSource = dqSourceStreamLookup.GetLookupSource ();
544
+ streamLookupSource.SetProviderName (compiledSource.GetType ());
545
+ *streamLookupSource.MutableLookupSource () = compiledSource.GetSettings ();
546
+
547
+ TTransform dqSourceStreamLookupTransform = {
548
+ .Type = " StreamLookupInputTransform" ,
549
+ .InputType = dqSourceStreamLookup.GetInputStageRowType (),
550
+ .OutputType = dqSourceStreamLookup.GetOutputStageRowType (),
551
+ };
552
+ YQL_ENSURE (dqSourceStreamLookupTransform.Settings .PackFrom (*settings));
553
+
554
+ for (const auto taskId : stageInfo.Tasks ) {
555
+ GetTask (taskId).Inputs [inputIndex].Transform = dqSourceStreamLookupTransform;
556
+ }
557
+
558
+ BuildUnionAllChannels (*this , stageInfo, inputIndex, inputStageInfo, outputIndex, /* enableSpilling */ false , logFunc);
559
+ }
560
+
520
561
void TKqpTasksGraph::BuildKqpStageChannels (TStageInfo& stageInfo, ui64 txId, bool enableSpilling, bool enableShuffleElimination) {
521
562
auto & stage = stageInfo.Meta .GetStage (stageInfo.Id );
522
563
@@ -709,6 +750,12 @@ void TKqpTasksGraph::BuildKqpStageChannels(TStageInfo& stageInfo, ui64 txId, boo
709
750
break ;
710
751
}
711
752
753
+ case NKqpProto::TKqpPhyConnection::kDqSourceStreamLookup : {
754
+ BuildDqSourceStreamLookupChannels (stageInfo, inputIdx, inputStageInfo, outputIdx,
755
+ input.GetDqSourceStreamLookup (), log);
756
+ break ;
757
+ }
758
+
712
759
default :
713
760
YQL_ENSURE (false , " Unexpected stage input type: " << (ui32)input.GetTypeCase ());
714
761
}
@@ -1369,6 +1416,8 @@ void TKqpTasksGraph::FillInputDesc(NYql::NDqProto::TTaskInput& inputDesc, const
1369
1416
}
1370
1417
1371
1418
transformProto->MutableSettings ()->PackFrom (*input.Meta .VectorResolveSettings );
1419
+ } else {
1420
+ *transformProto->MutableSettings () = input.Transform ->Settings ;
1372
1421
}
1373
1422
}
1374
1423
}
@@ -1724,6 +1773,7 @@ bool TKqpTasksGraph::BuildComputeTasks(TStageInfo& stageInfo, const ui32 nodesCo
1724
1773
case NKqpProto::TKqpPhyConnection::kMap :
1725
1774
case NKqpProto::TKqpPhyConnection::kParallelUnionAll :
1726
1775
case NKqpProto::TKqpPhyConnection::kVectorResolve :
1776
+ case NKqpProto::TKqpPhyConnection::kDqSourceStreamLookup :
1727
1777
break ;
1728
1778
default :
1729
1779
YQL_ENSURE (false , " Unexpected connection type: " << (ui32)input.GetTypeCase () << Endl);
0 commit comments