You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/04/03 21:40:46 UTC

[GitHub] [arrow] westonpace commented on a diff in pull request #33674: GH-15256: [C++][Dataset] Add support for writing with Partitioning::Default()

westonpace commented on code in PR #33674:
URL: https://github.com/apache/arrow/pull/33674#discussion_r1156481500


##########
cpp/src/arrow/dataset/partition_test.cc:
##########
@@ -189,6 +189,12 @@ TEST_F(TestPartitioning, Partition) {
                   expected_expressions);
 }
 
+TEST_F(TestPartitioning, DefaultPartitioningIsDirectoryPartitioning) {
+  auto partitioning = Partitioning::Default();
+  ASSERT_EQ(partitioning->type_name(), "directory");
+  AssertSchemaEqual(partitioning->schema(), schema({}));
+}
+

Review Comment:
   Can you also add a test to verify directory partitioning works with an empty schema?
   
   ```
   
   TEST_F(TestPartitioning, DirectoryPartitioningEmpty) {
     partitioning_ = std::make_shared<DirectoryPartitioning>(schema({}));
     written_schema_ = partitioning_->schema();
   
     // No partitioning info
     AssertParse("", literal(true));
     // Files can be in subdirectories
     AssertParse("/foo/", literal(true));
     // Partitioning info is discarded on write
     AssertFormat(equal(field_ref("alpha"), literal(7)), "");
   }
   ```



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