You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/13 11:52:05 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #10708: ARROW-13321 - [C++][Python] MakeArrayFromScalar doesn't work for FixedSizeBinaryType

lidavidm commented on a change in pull request #10708:
URL: https://github.com/apache/arrow/pull/10708#discussion_r668687689



##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -471,6 +471,12 @@ TEST_F(TestArray, TestMakeArrayFromScalar) {
       ASSERT_OK(array->ValidateFull());
       ASSERT_EQ(array->length(), length);
       ASSERT_EQ(array->null_count(), 0);
+
+      // test case for ARROW-13321
+      for (int64_t i : std::vector<int64_t>{0, length / 2, length - 1}) {
+        ASSERT_OK_AND_ASSIGN(auto s, array->GetScalar(i));
+        ASSERT_TRUE(ScalarEquals(*s, *scalar));

Review comment:
       AssertScalarEquals?

##########
File path: cpp/src/arrow/compute/kernels/codegen_internal.h
##########
@@ -311,7 +311,8 @@ struct UnboxScalar<Type, enable_if_has_c_type<Type>> {
 };
 
 template <typename Type>
-struct UnboxScalar<Type, enable_if_base_binary<Type>> {
+struct UnboxScalar<Type, enable_if_t<is_base_binary_type<Type>::value ||
+                                     is_fixed_size_binary_type<Type>::value>> {

Review comment:
       enable_if_has_string_view?
   
   https://github.com/apache/arrow/blob/090e2cf3377e7975fa253664296b92ea873f08fb/cpp/src/arrow/type_traits.h#L728-L737




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org