Skip to content
Open
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
3 changes: 2 additions & 1 deletion cpp/src/arrow/compute/expression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,8 @@ Result<ExecBatch> MakeExecBatch(const Schema& full_schema, const Datum& partial,
}

// wasteful but useful for testing:
if (partial.type()->id() == Type::STRUCT) {
const auto& partial_type = partial.type();
if (partial_type && partial_type->id() == Type::STRUCT) {
if (partial.is_array()) {
ARROW_ASSIGN_OR_RAISE(auto partial_batch,
RecordBatch::FromStructArray(partial.make_array()));
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/compute/expression_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ TEST(ExpressionUtils, MakeExecBatch) {
auto duplicated_names =
RecordBatch::Make(schema({GetField("i32"), GetField("i32")}), kNumRows, {i32, i32});
ASSERT_RAISES(Invalid, MakeExecBatch(*kBoringSchema, duplicated_names));

ASSERT_OK_AND_ASSIGN(auto boring_table, Table::MakeEmpty(kBoringSchema));
ASSERT_RAISES(NotImplemented, MakeExecBatch(*kBoringSchema, boring_table));
}

class WidgetifyOptions : public compute::FunctionOptions {
Expand Down