@@ -698,17 +698,20 @@ using TBaseComputation = TStatefulWideFlowCodegeneratorNode<TWideFromBlocksWrapp
698
698
TUnboxedValueVector Values_;
699
699
std::vector<std::unique_ptr<IBlockReader>> Readers_;
700
700
std::vector<std::unique_ptr<IBlockItemConverter>> Converters_;
701
+ const std::vector<arrow::ValueDescr> ValuesDescr_;
701
702
702
703
TState (TMemoryUsageInfo* memInfo, TComputationContext& ctx, const TVector<TType*>& types)
703
704
: TComputationValue(memInfo)
704
705
, Values_(types.size() + 1 )
706
+ , ValuesDescr_(ToValueDescr(types))
705
707
{
706
708
Pointer_ = Values_.data ();
707
709
708
710
const auto & pgBuilder = ctx.Builder ->GetPgBuilder ();
709
711
for (size_t i = 0 ; i < types.size (); ++i) {
710
- Readers_.push_back (MakeBlockReader (TTypeInfoHelper (), types[i]));
711
- Converters_.push_back (MakeBlockItemConverter (TTypeInfoHelper (), types[i], pgBuilder));
712
+ const TType* blockItemType = AS_TYPE (TBlockType, types[i])->GetItemType ();
713
+ Readers_.push_back (MakeBlockReader (TTypeInfoHelper (), blockItemType));
714
+ Converters_.push_back (MakeBlockItemConverter (TTypeInfoHelper (), blockItemType, pgBuilder));
712
715
}
713
716
}
714
717
@@ -718,7 +721,9 @@ using TBaseComputation = TStatefulWideFlowCodegeneratorNode<TWideFromBlocksWrapp
718
721
719
722
NUdf::TUnboxedValuePod Get (const THolderFactory& holderFactory, size_t idx) const {
720
723
TBlockItem item;
721
- if (const auto & datum = TArrowBlock::From (Values_[idx]).GetDatum (); datum.is_scalar ()) {
724
+ const auto & datum = TArrowBlock::From (Values_[idx]).GetDatum ();
725
+ Y_DEBUG_ABORT_UNLESS (ValuesDescr_[idx] == datum.descr ());
726
+ if (datum.is_scalar ()) {
722
727
item = Readers_[idx]->GetScalarItem (*datum.scalar ());
723
728
} else {
724
729
MKQL_ENSURE (datum.is_array (), " Expecting array" );
@@ -1230,8 +1235,7 @@ IComputationNode* WrapWideFromBlocks(TCallable& callable, const TComputationNode
1230
1235
MKQL_ENSURE (wideComponents.size () > 0 , " Expected at least one column" );
1231
1236
TVector<TType*> items;
1232
1237
for (ui32 i = 0 ; i < wideComponents.size () - 1 ; ++i) {
1233
- const auto blockType = AS_TYPE (TBlockType, wideComponents[i]);
1234
- items.push_back (blockType->GetItemType ());
1238
+ items.push_back (AS_TYPE (TBlockType, wideComponents[i]));
1235
1239
}
1236
1240
1237
1241
const auto wideFlow = dynamic_cast <IComputationWideFlowNode*>(LocateNode (ctx.NodeLocator , callable, 0 ));
0 commit comments