Skip to content

Commit

Permalink
.make + bool
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLolthe1st committed Dec 20, 2023
1 parent 026d2e1 commit 7574b64
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
25 changes: 21 additions & 4 deletions ydb/library/yql/providers/yt/comp_nodes/dq/arrow_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ arrow::Datum NumericConverterImpl(NUdf::IArrayBuilder* builder, std::shared_ptr<
if (val.IsNull(i)) {
builder->Add(NUdf::TBlockItem{});
} else {
builder->Add(NUdf::TBlockItem(val.Value(i)));
if constexpr (std::is_same_v<decltype(val.Value(i)), bool>) {
builder->Add(NUdf::TBlockItem((ui8)val.Value(i)));
} else {
builder->Add(NUdf::TBlockItem(val.Value(i)));
}
}
}
} else {
for (i64 i = 0; i < block->length; ++i) {
builder->Add(NUdf::TBlockItem(val.Value(i)));
if constexpr (std::is_same_v<decltype(val.Value(i)), bool>) {
builder->Add(NUdf::TBlockItem((ui8)val.Value(i)));
} else {
builder->Add(NUdf::TBlockItem(val.Value(i)));
}
}
}
return builder->Build(false);
Expand All @@ -56,12 +64,20 @@ arrow::Datum NumericConverterImpl(NUdf::IArrayBuilder* builder, std::shared_ptr<
if (dict.IsNull(i)) {
builder->Add(NUdf::TBlockItem{});
} else {
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
if constexpr (std::is_same_v<decltype(val.Value(data[i])), bool>) {
builder->Add(NUdf::TBlockItem((ui8)val.Value(data[i])));
} else {
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
}
}
}
} else {
for (i64 i = 0; i < block->length; ++i) {
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
if constexpr (std::is_same_v<decltype(val.Value(data[i])), bool>) {
builder->Add(NUdf::TBlockItem((ui8)val.Value(data[i])));
} else {
builder->Add(NUdf::TBlockItem(val.Value(data[i])));
}
}
}
return builder->Build(false);
Expand Down Expand Up @@ -402,6 +418,7 @@ class TPrimitiveColumnConverter {
public:
TPrimitiveColumnConverter(TYtColumnConverterSettings& settings) : Settings_(settings) {
switch (Settings_.ArrowType->id()) {
case arrow::Type::BOOL: PrimitiveConverterImpl_ = GEN_TYPE(Boolean); break;
case arrow::Type::INT8: PrimitiveConverterImpl_ = GEN_TYPE(Int8); break;
case arrow::Type::UINT8: PrimitiveConverterImpl_ = GEN_TYPE(UInt8); break;
case arrow::Type::INT16: PrimitiveConverterImpl_ = GEN_TYPE(Int16); break;
Expand Down
3 changes: 2 additions & 1 deletion ydb/library/yql/providers/yt/comp_nodes/dq/ya.make
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
LIBRARY()

PEERDIR(
ydb/library/yql/minikql
ydb/library/yql/minikql/computation/llvm
ydb/library/yql/providers/yt/comp_nodes
ydb/library/yql/providers/yt/codec
ydb/library/yql/providers/common/codec
ydb/core/formats/arrow
yt/cpp/mapreduce/interface
yt/cpp/mapreduce/common
library/cpp/yson/node
Expand All @@ -27,6 +27,7 @@ IF(LINUX)
)

SRCS(
arrow_converter.cpp
stream_decoder.cpp
dq_yt_rpc_reader.cpp
dq_yt_rpc_helpers.cpp
Expand Down

0 comments on commit 7574b64

Please sign in to comment.