Skip to content
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
4 changes: 2 additions & 2 deletions cpp/src/arrow/acero/hash_join_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ Status HashJoinSchema::ValidateSchemas(JoinType join_type, const Schema& left_sc
const auto& type = *field->type();
if (!IsTypeSupported(type)) {
return Status::Invalid("Data type ", type,
" is not supported in join non-key field");
" is not supported in join non-key field ", field->name());
}
}
for (const auto& field : right_schema.fields()) {
const auto& type = *field->type();
if (!IsTypeSupported(type)) {
return Status::Invalid("Data type ", type,
" is not supported in join non-key field");
" is not supported in join non-key field ", field->name());
}
}

Expand Down
24 changes: 24 additions & 0 deletions python/pyarrow/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2422,3 +2422,27 @@ def test_numpy_asarray(constructor):
result = np.asarray(table3, dtype="int32")
np.testing.assert_allclose(result, expected)
assert result.dtype == "int32"


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add @pytest.mark.acero because this depends on Acero.

I'm adding it in #36681 but we may want to do it in a separated PR only for it...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've split the fix to #36683.

def test_invalid_non_join_column():
NUM_ITEMS = 30
t1 = pa.Table.from_pydict({
'id': range(NUM_ITEMS),
'array_column': [[z for z in range(3)] for x in range(NUM_ITEMS)],
})
t2 = pa.Table.from_pydict({
'id': range(NUM_ITEMS),
'value': [x for x in range(NUM_ITEMS)]
})

# check as left table
with pytest.raises(pa.lib.ArrowInvalid) as excinfo:
t1.join(t2, 'id', join_type='inner')
exp_error_msg = "Data type list<item: int64> is not supported " \
+ "in join non-key field array_column"
assert exp_error_msg in str(excinfo.value)

# check as right table
with pytest.raises(pa.lib.ArrowInvalid) as excinfo:
t2.join(t1, 'id', join_type='inner')
assert exp_error_msg in str(excinfo.value)