Skip to content

Commit

Permalink
Use dispatch_storage_type in get_data_ptr.
Browse files Browse the repository at this point in the history
get_data_ptr was erroneously invoking
column_view::data<decimal32/64>().

As it happens, this ended up being okay
when the column did not have any offset as
column_view::data<int32>() and
column_view::data<decimal32>() will
return the same initial pointer when the
offset is zero. The problem occurs when you
attempt to advance this pointer, or if the
column had an offset (which internally will advance the pointer).
  • Loading branch information
jrhemstad committed Mar 26, 2021
1 parent f99318e commit a4788a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/src/jit/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ struct get_data_ptr_functor {

const void* get_data_ptr(column_view const& view)
{
return type_dispatcher(view.type(), get_data_ptr_functor{}, view);
return type_dispatcher<dispatch_storage_type>(view.type(), get_data_ptr_functor{}, view);
}

const void* get_data_ptr(scalar const& s)
{
return type_dispatcher(s.type(), get_data_ptr_functor{}, s);
return type_dispatcher<dispatch_storage_type>(s.type(), get_data_ptr_functor{}, s);
}

std::string get_type_name(data_type type)
Expand Down

0 comments on commit a4788a0

Please sign in to comment.