Skip to content

Commit 0773155

Browse files
authored
Fix arrow yt column converter (#8279)
1 parent bcd51b5 commit 0773155

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ydb/library/yql/providers/yt/comp_nodes/dq/arrow_converter.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,15 @@ class TYtColumnConverter final : public IYtColumnConverter {
619619

620620
arrow::Datum Convert(std::shared_ptr<arrow::ArrayData> block) override {
621621
if (arrow::Type::DICTIONARY == block->type->id()) {
622-
if (static_cast<const arrow::DictionaryType&>(*block->type).value_type()->Equals(Settings_.ArrowType)) {
622+
auto valType = static_cast<const arrow::DictionaryType&>(*block->type).value_type();
623+
if (valType->Equals(Settings_.ArrowType)) {
624+
// just unpack
623625
return DictPrimitiveConverter_.Convert(block);
626+
} else if (arrow::Type::UINT8 == Settings_.ArrowType->id() && arrow::Type::BOOL == valType->id()) {
627+
// unpack an cast
628+
auto result = arrow::compute::Cast(DictPrimitiveConverter_.Convert(block), Settings_.ArrowType);
629+
YQL_ENSURE(result.ok());
630+
return *result;
624631
} else {
625632
return DictYsonConverter_.Convert(block);
626633
}
@@ -631,7 +638,7 @@ class TYtColumnConverter final : public IYtColumnConverter {
631638
return block;
632639
} else if (arrow::Type::UINT8 == Settings_.ArrowType->id() && arrow::Type::BOOL == blockType->id()) {
633640
auto result = arrow::compute::Cast(arrow::Datum(*block), Settings_.ArrowType);
634-
Y_ENSURE(result.ok());
641+
YQL_ENSURE(result.ok());
635642
return *result;
636643
} else {
637644
YQL_ENSURE(arrow::Type::BINARY == blockType->id());

0 commit comments

Comments
 (0)