@@ -168,9 +168,8 @@ class TInputTransformStreamLookupBase
168
168
const auto maxKeysInRequest = LookupSource.first ->GetMaxSupportedKeysInRequest ();
169
169
IDqAsyncLookupSource::TUnboxedValueMap keysForLookup{maxKeysInRequest, KeyTypeHelper->GetValueHash (), KeyTypeHelper->GetValueEqual ()};
170
170
while (
171
- ((InputFlowFetchStatus = FetchWideInputValue (inputRowItems)) == NUdf::EFetchStatus::Ok) &&
172
- (keysForLookup.size () < maxKeysInRequest)
173
- ) {
171
+ (keysForLookup.size () < maxKeysInRequest) &&
172
+ ((InputFlowFetchStatus = FetchWideInputValue (inputRowItems)) == NUdf::EFetchStatus::Ok)) {
174
173
NUdf::TUnboxedValue* keyItems;
175
174
NUdf::TUnboxedValue key = HolderFactory.CreateDirectArrayHolder (InputJoinColumns.size (), keyItems);
176
175
for (size_t i = 0 ; i != InputJoinColumns.size (); ++i) {
@@ -384,6 +383,25 @@ THashMap<TStringBuf, size_t> GetNameToIndex(const ::google::protobuf::RepeatedPt
384
383
return result;
385
384
}
386
385
386
+ THashMap<TStringBuf, size_t > GetNameToIndex (const NMiniKQL::TStructType* type) {
387
+ THashMap<TStringBuf, size_t > result;
388
+ for (ui32 i = 0 ; i != type->GetMembersCount (); ++i) {
389
+ result[type->GetMemberName (i)] = i;
390
+ }
391
+ return result;
392
+ }
393
+
394
+ TVector<size_t > GetJoinColumnIndexes (const ::google::protobuf::RepeatedPtrField<TProtoStringType>& names, const THashMap<TStringBuf, size_t >& joinColumns) {
395
+ TVector<size_t > result;
396
+ result.reserve (joinColumns.size ());
397
+ for (int i = 0 ; i != names.size (); ++i) {
398
+ if (auto p = joinColumns.FindPtr (names[i])) {
399
+ result.push_back (*p);
400
+ }
401
+ }
402
+ return result;
403
+ }
404
+
387
405
TVector<size_t > GetJoinColumnIndexes (const NMiniKQL::TStructType* type, const THashMap<TStringBuf, size_t >& joinColumns) {
388
406
TVector<size_t > result;
389
407
result.reserve (joinColumns.size ());
@@ -411,14 +429,15 @@ std::pair<IDqComputeActorAsyncInput*, NActors::IActor*> CreateInputTransformStre
411
429
412
430
const auto rightRowType = DeserializeStructType (settings.GetRightSource ().GetSerializedRowType (), args.TypeEnv );
413
431
414
- auto leftJoinColumns = GetNameToIndex (settings. GetLeftJoinKeyNames () );
432
+ auto inputColumns = GetNameToIndex (narrowInputRowType );
415
433
auto rightJoinColumns = GetNameToIndex (settings.GetRightJoinKeyNames ());
416
- Y_ABORT_UNLESS (leftJoinColumns.size () == rightJoinColumns.size ());
417
434
418
- auto leftJoinColumnIndexes = GetJoinColumnIndexes (narrowInputRowType, leftJoinColumns);
419
- Y_ABORT_UNLESS (leftJoinColumnIndexes.size () == leftJoinColumns.size ());
435
+ auto leftJoinColumnIndexes = GetJoinColumnIndexes (
436
+ settings.GetLeftJoinKeyNames (),
437
+ inputColumns);
420
438
auto rightJoinColumnIndexes = GetJoinColumnIndexes (rightRowType, rightJoinColumns);
421
439
Y_ABORT_UNLESS (rightJoinColumnIndexes.size () == rightJoinColumns.size ());
440
+ Y_ABORT_UNLESS (leftJoinColumnIndexes.size () == rightJoinColumnIndexes.size ());
422
441
423
442
const auto & [lookupKeyType, lookupPayloadType] = SplitLookupTableColumns (rightRowType, rightJoinColumns, args.TypeEnv );
424
443
const auto & outputColumnsOrder = CategorizeOutputRowItems (
0 commit comments