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 2022/04/01 16:10:54 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #12706: ARROW-15961: [C++] Check nullability when validating fields on batches or struct arrays

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



##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -78,6 +78,25 @@ class TestArray : public ::testing::Test {
   MemoryPool* pool_;
 };
 
+TEST_F(TestArray, ValidateFullNullableList) {
+  auto f1 = field("f1", int32(), /*nullable=*/false);
+  auto type1 = std::make_shared<ListType>(f1);

Review comment:
       ```suggestion
   ```

##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -78,6 +78,25 @@ class TestArray : public ::testing::Test {
   MemoryPool* pool_;
 };
 
+TEST_F(TestArray, ValidateFullNullableList) {
+  auto f1 = field("f1", int32(), /*nullable=*/false);
+  auto type1 = std::make_shared<ListType>(f1);
+  auto ty = list(f1);
+  auto array = ArrayFromJSON(ty, "[[0, 1, 2, null], null, [4, 5]]");
+  ASSERT_RAISES(Invalid, array->ValidateFull());
+}
+
+TEST_F(TestArray, ValidateFullNullableFixedSizeList) {
+  auto f0 = field("f0", int32(), /*nullable=*/false);
+  auto type = std::make_shared<FixedSizeListType>(f0, 2);

Review comment:
       ```suggestion
     auto type = fixed_size_list(f0, 2);
   ```

##########
File path: cpp/src/arrow/array/array_test.cc
##########
@@ -78,6 +78,25 @@ class TestArray : public ::testing::Test {
   MemoryPool* pool_;
 };
 
+TEST_F(TestArray, ValidateFullNullableList) {
+  auto f1 = field("f1", int32(), /*nullable=*/false);
+  auto type1 = std::make_shared<ListType>(f1);

Review comment:
       This line looks redundant?




-- 
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