MCPcopy Create free account
hub / github.com/apache/arrow / AssertFormat

Method AssertFormat

cpp/src/arrow/dataset/partition_test.cc:66–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 void AssertFormat(compute::Expression expr, const std::string& expected_directory,
67 const std::string& expected_filename = "") {
68 // formatted partition expressions are bound to the schema of the dataset being
69 // written
70 ASSERT_OK_AND_ASSIGN(auto formatted, partitioning_->Format(expr));
71 ASSERT_EQ(formatted.directory, expected_directory);
72 ASSERT_EQ(formatted.filename, expected_filename);
73
74 // if ((formatted.filename).empty()){
75 // formatted.filename = "format.parquet";
76 // }
77 // ensure the formatted path round trips the relevant components of the partition
78 // expression: roundtripped should be a subset of expr
79 ASSERT_OK_AND_ASSIGN(compute::Expression roundtripped,
80 partitioning_->Parse(formatted.directory + formatted.filename));
81 ASSERT_OK_AND_ASSIGN(roundtripped, roundtripped.Bind(*written_schema_));
82 ASSERT_OK_AND_ASSIGN(auto simplified, SimplifyWithGuarantee(roundtripped, expr));
83 ASSERT_EQ(simplified, literal(true));
84 }
85
86 void AssertInspect(const std::vector<std::string>& paths,
87 const std::vector<std::shared_ptr<Field>>& expected) {

Callers

nothing calls this directly

Calls 3

ASSERT_OK_AND_ASSIGNFunction · 0.70
literalFunction · 0.50
BindMethod · 0.45

Tested by

no test coverage detected