You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Niranda Perera <ni...@gmail.com> on 2021/07/13 01:27:56 UTC
possible bug in MakeArrayFromScalar
Hi all,
It seems like there's a bug in MakeArrayFromScalar for
FixedSizedBinaryType.
https://github.com/apache/arrow/blob/e990d177b1f1dec962315487682f613d46be573c/cpp/src/arrow/array/util.cc#L516
```c++
template <typename T>
enable_if_t<is_number_type<T>::value ||
is_fixed_size_binary_type<T>::value ||
is_temporal_type<T>::value,
Status>
Visit(const T&) {
auto value = checked_cast<const typename
TypeTraits<T>::ScalarType&>(scalar_).value;
return FinishFixedWidth(&value, sizeof(value));
}
```
` sizeof(value)` doesn't give the byte width of FSB type, does it?
--
Niranda Perera
https://niranda.dev/
@n1r44 <https://twitter.com/N1R44>
Re: possible bug in MakeArrayFromScalar
Posted by Niranda Perera <ni...@gmail.com>.
I created a JIRA and added the fix.
https://issues.apache.org/jira/browse/ARROW-13321
On Mon, Jul 12, 2021 at 10:17 PM Niranda Perera <ni...@gmail.com>
wrote:
> Ah. Indeed! :-)
> Yes, shall we pull it out into a new JIRA and add it to master? :-)
>
> On Mon, Jul 12, 2021 at 10:05 PM David Li <li...@apache.org> wrote:
>
>> I noticed the same thing here:
>> https://github.com/apache/arrow/pull/10642/files#diff-c3b0484ad8586ff46fa035d446a7d1c3a30cd35d13cd05678c99814938e07d5b
>>
>> If it helps I can pull that out into a separate JIRA (or feel free to do
>> so as well).
>>
>> -David
>>
>> On Mon, Jul 12, 2021, at 21:27, Niranda Perera wrote:
>> > Hi all,
>> > It seems like there's a bug in MakeArrayFromScalar for
>> > FixedSizedBinaryType.
>> >
>> https://github.com/apache/arrow/blob/e990d177b1f1dec962315487682f613d46be573c/cpp/src/arrow/array/util.cc#L516
>> >
>> > ```c++
>> > template <typename T>
>> > enable_if_t<is_number_type<T>::value ||
>> > is_fixed_size_binary_type<T>::value ||
>> > is_temporal_type<T>::value,
>> > Status>
>> > Visit(const T&) {
>> > auto value = checked_cast<const typename
>> > TypeTraits<T>::ScalarType&>(scalar_).value;
>> > return FinishFixedWidth(&value, sizeof(value));
>> > }
>> > ```
>> > ` sizeof(value)` doesn't give the byte width of FSB type, does it?
>> >
>> > --
>> > Niranda Perera
>> > https://niranda.dev/
>> > @n1r44 <https://twitter.com/N1R44>
>> >
>>
>
>
> --
> Niranda Perera
> https://niranda.dev/
> @n1r44 <https://twitter.com/N1R44>
>
>
--
Niranda Perera
https://niranda.dev/
@n1r44 <https://twitter.com/N1R44>
Re: possible bug in MakeArrayFromScalar
Posted by Niranda Perera <ni...@gmail.com>.
Ah. Indeed! :-)
Yes, shall we pull it out into a new JIRA and add it to master? :-)
On Mon, Jul 12, 2021 at 10:05 PM David Li <li...@apache.org> wrote:
> I noticed the same thing here:
> https://github.com/apache/arrow/pull/10642/files#diff-c3b0484ad8586ff46fa035d446a7d1c3a30cd35d13cd05678c99814938e07d5b
>
> If it helps I can pull that out into a separate JIRA (or feel free to do
> so as well).
>
> -David
>
> On Mon, Jul 12, 2021, at 21:27, Niranda Perera wrote:
> > Hi all,
> > It seems like there's a bug in MakeArrayFromScalar for
> > FixedSizedBinaryType.
> >
> https://github.com/apache/arrow/blob/e990d177b1f1dec962315487682f613d46be573c/cpp/src/arrow/array/util.cc#L516
> >
> > ```c++
> > template <typename T>
> > enable_if_t<is_number_type<T>::value ||
> > is_fixed_size_binary_type<T>::value ||
> > is_temporal_type<T>::value,
> > Status>
> > Visit(const T&) {
> > auto value = checked_cast<const typename
> > TypeTraits<T>::ScalarType&>(scalar_).value;
> > return FinishFixedWidth(&value, sizeof(value));
> > }
> > ```
> > ` sizeof(value)` doesn't give the byte width of FSB type, does it?
> >
> > --
> > Niranda Perera
> > https://niranda.dev/
> > @n1r44 <https://twitter.com/N1R44>
> >
>
--
Niranda Perera
https://niranda.dev/
@n1r44 <https://twitter.com/N1R44>
Re: possible bug in MakeArrayFromScalar
Posted by David Li <li...@apache.org>.
I noticed the same thing here: https://github.com/apache/arrow/pull/10642/files#diff-c3b0484ad8586ff46fa035d446a7d1c3a30cd35d13cd05678c99814938e07d5b
If it helps I can pull that out into a separate JIRA (or feel free to do so as well).
-David
On Mon, Jul 12, 2021, at 21:27, Niranda Perera wrote:
> Hi all,
> It seems like there's a bug in MakeArrayFromScalar for
> FixedSizedBinaryType.
> https://github.com/apache/arrow/blob/e990d177b1f1dec962315487682f613d46be573c/cpp/src/arrow/array/util.cc#L516
>
> ```c++
> template <typename T>
> enable_if_t<is_number_type<T>::value ||
> is_fixed_size_binary_type<T>::value ||
> is_temporal_type<T>::value,
> Status>
> Visit(const T&) {
> auto value = checked_cast<const typename
> TypeTraits<T>::ScalarType&>(scalar_).value;
> return FinishFixedWidth(&value, sizeof(value));
> }
> ```
> ` sizeof(value)` doesn't give the byte width of FSB type, does it?
>
> --
> Niranda Perera
> https://niranda.dev/
> @n1r44 <https://twitter.com/N1R44>
>