@@ -1912,5 +1912,35 @@ TEST(AsofJoinTest, StructTestDataType) {
19121912 ])" );
19131913 AssertExecBatchesEqual (result.schema , {exp_batch}, result.batches );
19141914}
1915+
1916+ TEST (AsofJoinTest, MapTestDataType) {
1917+ auto map_type = map (int64 (), int64 ());
1918+
1919+ auto left_batch = ExecBatchFromJSON ({int64 ()}, R"( [[1], [2], [3]])" );
1920+ auto right_batch = ExecBatchFromJSON ({map_type, int64 ()}, R"( [
1921+ [[[11, 111], [22, 222]], 2],
1922+ [[[33, 333], [44, 444], [77, 777]], 3],
1923+ [[[55, 555], [66, 666]], 4]
1924+ ])" );
1925+
1926+ Declaration left{" exec_batch_source" ,
1927+ ExecBatchSourceNodeOptions (schema ({field (" on" , int64 ())}),
1928+ {std::move (left_batch)})};
1929+ Declaration right{
1930+ " exec_batch_source" ,
1931+ ExecBatchSourceNodeOptions (schema ({field (" col" , map_type), field (" on" , int64 ())}),
1932+ {std::move (right_batch)})};
1933+ AsofJoinNodeOptions asof_join_opts ({{{" on" }, {}}, {{" on" }, {}}}, 1 );
1934+ Declaration asof_join{
1935+ " asofjoin" , {std::move (left), std::move (right)}, std::move (asof_join_opts)};
1936+
1937+ ASSERT_OK_AND_ASSIGN (auto result, DeclarationToExecBatches (std::move (asof_join)));
1938+ auto exp_batch = ExecBatchFromJSON ({int64 (), map_type}, R"( [
1939+ [1, [[11, 111], [22, 222]]],
1940+ [2, [[11, 111], [22, 222]]],
1941+ [3, [[33, 333], [44, 444], [77, 777]]]
1942+ ])" );
1943+ AssertExecBatchesEqual (result.schema , {exp_batch}, result.batches );
1944+ }
19151945} // namespace acero
19161946} // namespace arrow
0 commit comments