@@ -1517,7 +1517,7 @@ bool ConvertArrowType(NUdf::EDataSlot slot, std::shared_ptr<arrow::DataType>& ty
15171517 }
15181518}
15191519
1520- bool ConvertArrowType (TType* itemType, std::shared_ptr<arrow::DataType>& type, const TArrowConvertFailedCallback& onFail) {
1520+ bool ConvertArrowType (TType* itemType, std::shared_ptr<arrow::DataType>& type, bool extraTypes, const TArrowConvertFailedCallback& onFail) {
15211521 bool isOptional;
15221522 auto unpacked = UnpackOptional (itemType, isOptional);
15231523 if (unpacked->IsOptional () || isOptional && unpacked->IsPg ()) {
@@ -1538,7 +1538,7 @@ bool ConvertArrowType(TType* itemType, std::shared_ptr<arrow::DataType>& type, c
15381538
15391539 // previousType is always Optional
15401540 std::shared_ptr<arrow::DataType> innerArrowType;
1541- if (!ConvertArrowType (previousType, innerArrowType, onFail)) {
1541+ if (!ConvertArrowType (previousType, innerArrowType, extraTypes, onFail)) {
15421542 return false ;
15431543 }
15441544
@@ -1560,7 +1560,7 @@ bool ConvertArrowType(TType* itemType, std::shared_ptr<arrow::DataType>& type, c
15601560 std::shared_ptr<arrow::DataType> childType;
15611561 const TString memberName (structType->GetMemberName (i));
15621562 auto memberType = structType->GetMemberType (i);
1563- if (!ConvertArrowType (memberType, childType, onFail)) {
1563+ if (!ConvertArrowType (memberType, childType, extraTypes, onFail)) {
15641564 return false ;
15651565 }
15661566 members.emplace_back (std::make_shared<arrow::Field>(memberName, childType, memberType->IsOptional ()));
@@ -1570,13 +1570,27 @@ bool ConvertArrowType(TType* itemType, std::shared_ptr<arrow::DataType>& type, c
15701570 return true ;
15711571 }
15721572
1573+ if (extraTypes) {
1574+ if (unpacked->IsList ()) {
1575+ auto listType = AS_TYPE (TListType, unpacked);
1576+ std::shared_ptr<arrow::DataType> childType;
1577+ auto itemType = listType->GetItemType ();
1578+ if (!ConvertArrowType (itemType, childType, extraTypes)) {
1579+ return false ;
1580+ }
1581+ type = std::make_shared<arrow::ListType>(std::make_shared<arrow::Field>(" item" , childType, itemType->IsOptional ()));
1582+ return true ;
1583+ }
1584+ }
1585+
1586+
15731587 if (unpacked->IsTuple ()) {
15741588 auto tupleType = AS_TYPE (TTupleType, unpacked);
15751589 std::vector<std::shared_ptr<arrow::Field>> fields;
15761590 for (ui32 i = 0 ; i < tupleType->GetElementsCount (); ++i) {
15771591 std::shared_ptr<arrow::DataType> childType;
15781592 auto elementType = tupleType->GetElementType (i);
1579- if (!ConvertArrowType (elementType, childType, onFail)) {
1593+ if (!ConvertArrowType (elementType, childType, extraTypes, onFail)) {
15801594 return false ;
15811595 }
15821596
@@ -2424,6 +2438,10 @@ size_t CalcMaxBlockItemSize(const TType* type) {
24242438 return result;
24252439 }
24262440
2441+ if (type->IsList ()) {
2442+ return sizeof (NYql::NUdf::TUnboxedValue);
2443+ }
2444+
24272445 if (type->IsTuple ()) {
24282446 auto tupleType = AS_TYPE (TTupleType, type);
24292447 size_t result = 0 ;
@@ -2526,6 +2544,11 @@ struct TComparatorTraits {
25262544 return std::unique_ptr<TResult>(MakePgItemComparator (desc.TypeId ).Release ());
25272545 }
25282546
2547+ static std::unique_ptr<TResult> MakeList (bool isOptional, std::unique_ptr<NYql::NUdf::IBlockItemComparator>&& inner) {
2548+ Y_UNUSED (isOptional, inner);
2549+ ythrow yexception () << " Comparator not implemented for block list: " ;
2550+ }
2551+
25292552 static std::unique_ptr<TResult> MakeResource (bool isOptional) {
25302553 Y_UNUSED (isOptional);
25312554 ythrow yexception () << " Comparator not implemented for block resources: " ;
@@ -2558,6 +2581,11 @@ struct THasherTraits {
25582581 return std::unique_ptr<TResult>(MakePgItemHasher (desc.TypeId ).Release ());
25592582 }
25602583
2584+ static std::unique_ptr<TResult> MakeList (bool isOptional, std::unique_ptr<NYql::NUdf::IBlockItemHasher>&& inner) {
2585+ Y_UNUSED (isOptional, inner);
2586+ ythrow yexception () << " Hasher not implemented for list" ;
2587+ }
2588+
25612589 static std::unique_ptr<TResult> MakeResource (bool isOptional) {
25622590 Y_UNUSED (isOptional);
25632591 ythrow yexception () << " Hasher not implemented for block resources" ;
0 commit comments