Skip to content

Make Arrow Datum check message more verbose #4308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/library/yql/minikql/comp_nodes/mkql_blocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ using TBaseComputation = TStatefulWideFlowCodegeneratorNode<TWideFromBlocksWrapp
NUdf::TUnboxedValuePod Get(const THolderFactory& holderFactory, size_t idx) const {
TBlockItem item;
const auto& datum = TArrowBlock::From(Values_[idx]).GetDatum();
Y_DEBUG_ABORT_UNLESS(ValuesDescr_[idx] == datum.descr());
ARROW_DEBUG_CHECK_DATUM_TYPES(ValuesDescr_[idx], datum.descr());
if (datum.is_scalar()) {
item = Readers_[idx]->GetScalarItem(*datum.scalar());
} else {
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/minikql/computation/mkql_block_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ NUdf::TUnboxedValuePod TBlockFuncNode::DoCalculate(TComputationContext& ctx) con
std::vector<arrow::Datum> argDatums;
for (ui32 i = 0; i < ArgsNodes.size(); ++i) {
argDatums.emplace_back(TArrowBlock::From(ArgsNodes[i]->GetValue(ctx)).GetDatum());
Y_DEBUG_ABORT_UNLESS(ArgsValuesDescr[i] == argDatums.back().descr());
ARROW_DEBUG_CHECK_DATUM_TYPES(ArgsValuesDescr[i], argDatums.back().descr());
}

if (ScalarOutput) {
Expand Down
5 changes: 5 additions & 0 deletions ydb/library/yql/public/udf/arrow/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ do {
}()

#define ARROW_RESULT(op) ARROW_RESULT_S(op, "Bad status")

#define ARROW_DEBUG_CHECK_DATUM_TYPES(expected, got) do { \
Y_DEBUG_ABORT_UNLESS((expected) == (got), "Bad datum type: %s expected, %s got", \
(expected).ToString().c_str(), (got).ToString().c_str()); \
} while(false)
Loading