Skip to content

Commit 7574b64

Browse files
committed
.make + bool
1 parent 026d2e1 commit 7574b64

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,20 @@ arrow::Datum NumericConverterImpl(NUdf::IArrayBuilder* builder, std::shared_ptr<
3838
if (val.IsNull(i)) {
3939
builder->Add(NUdf::TBlockItem{});
4040
} else {
41-
builder->Add(NUdf::TBlockItem(val.Value(i)));
41+
if constexpr (std::is_same_v<decltype(val.Value(i)), bool>) {
42+
builder->Add(NUdf::TBlockItem((ui8)val.Value(i)));
43+
} else {
44+
builder->Add(NUdf::TBlockItem(val.Value(i)));
45+
}
4246
}
4347
}
4448
} else {
4549
for (i64 i = 0; i < block->length; ++i) {
46-
builder->Add(NUdf::TBlockItem(val.Value(i)));
50+
if constexpr (std::is_same_v<decltype(val.Value(i)), bool>) {
51+
builder->Add(NUdf::TBlockItem((ui8)val.Value(i)));
52+
} else {
53+
builder->Add(NUdf::TBlockItem(val.Value(i)));
54+
}
4755
}
4856
}
4957
return builder->Build(false);
@@ -56,12 +64,20 @@ arrow::Datum NumericConverterImpl(NUdf::IArrayBuilder* builder, std::shared_ptr<
5664
if (dict.IsNull(i)) {
5765
builder->Add(NUdf::TBlockItem{});
5866
} else {
59-
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
67+
if constexpr (std::is_same_v<decltype(val.Value(data[i])), bool>) {
68+
builder->Add(NUdf::TBlockItem((ui8)val.Value(data[i])));
69+
} else {
70+
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
71+
}
6072
}
6173
}
6274
} else {
6375
for (i64 i = 0; i < block->length; ++i) {
64-
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
76+
if constexpr (std::is_same_v<decltype(val.Value(data[i])), bool>) {
77+
builder->Add(NUdf::TBlockItem((ui8)val.Value(data[i])));
78+
} else {
79+
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
80+
}
6581
}
6682
}
6783
return builder->Build(false);
@@ -402,6 +418,7 @@ class TPrimitiveColumnConverter {
402418
public:
403419
TPrimitiveColumnConverter(TYtColumnConverterSettings& settings) : Settings_(settings) {
404420
switch (Settings_.ArrowType->id()) {
421+
case arrow::Type::BOOL: PrimitiveConverterImpl_ = GEN_TYPE(Boolean); break;
405422
case arrow::Type::INT8: PrimitiveConverterImpl_ = GEN_TYPE(Int8); break;
406423
case arrow::Type::UINT8: PrimitiveConverterImpl_ = GEN_TYPE(UInt8); break;
407424
case arrow::Type::INT16: PrimitiveConverterImpl_ = GEN_TYPE(Int16); break;

ydb/library/yql/providers/yt/comp_nodes/dq/ya.make

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
LIBRARY()
22

33
PEERDIR(
4+
ydb/library/yql/minikql
45
ydb/library/yql/minikql/computation/llvm
56
ydb/library/yql/providers/yt/comp_nodes
67
ydb/library/yql/providers/yt/codec
78
ydb/library/yql/providers/common/codec
8-
ydb/core/formats/arrow
99
yt/cpp/mapreduce/interface
1010
yt/cpp/mapreduce/common
1111
library/cpp/yson/node
@@ -27,6 +27,7 @@ IF(LINUX)
2727
)
2828

2929
SRCS(
30+
arrow_converter.cpp
3031
stream_decoder.cpp
3132
dq_yt_rpc_reader.cpp
3233
dq_yt_rpc_helpers.cpp

0 commit comments

Comments
 (0)