kou commented on code in PR #47204: URL: https://github.com/apache/arrow/pull/47204#discussion_r2234472648
########## cpp/src/arrow/compare.h: ########## @@ -83,6 +83,37 @@ class EqualOptions { return res; } + /// Whether the \ref arrow::Schema property is used in the comparison. + /// + /// This option only affects the Equals methods + /// and has no effect on ApproxEquals methods. + bool use_schema() const { return use_schema_; } + + /// Return a new EqualOptions object with the "use_schema_" property changed. + /// setting this option is false making the value of \ref EqualOptions::check_metadata_ + /// is useless. + EqualOptions use_schema(bool v) const { + auto res = EqualOptions(*this); + res.use_schema_ = v; + return res; + } + + /// Whether the "metadata" in \ref arrow::Schema is used in the comparison. + /// + /// This option only affects the Equals methods + /// and has no effect on the ApproxEquals methods. + /// + /// Note: This option is only considered when \ref arrow::EqualOptions::use_schema_ is + /// set to true. + bool check_metadata() const { return check_metadata_; } Review Comment: Ah, `use_metadata()` may be better to align other variables. ########## cpp/src/arrow/record_batch.h: ########## @@ -121,19 +121,24 @@ class ARROW_EXPORT RecordBatch { /// \brief Determine if two record batches are exactly equal /// /// \param[in] other the RecordBatch to compare with - /// \param[in] check_metadata if true, check that Schema metadata is the same + /// \param[in] check_metadata If true, the schema metadata will be compared, + /// regardless of the value set in \ref EqualOptions::check_metadata_. /// \param[in] opts the options for equality comparisons /// \return true if batches are equal bool Equals(const RecordBatch& other, bool check_metadata = false, const EqualOptions& opts = EqualOptions::Defaults()) const; + bool Equals(const RecordBatch& other, const EqualOptions& opts) const; Review Comment: Could you add a document? ########## cpp/src/arrow/util/key_value_metadata.h: ########## Review Comment: Can we revert this change from this PR? ########## cpp/src/arrow/util/key_value_metadata.cc: ########## Review Comment: Can we revert this change from this PR? -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org