rok commented on code in PR #36496:
URL: https://github.com/apache/arrow/pull/36496#discussion_r1304421363
##########
cpp/src/arrow/extension/fixed_shape_tensor.cc:
##########
@@ -104,6 +104,38 @@ bool FixedShapeTensorType::ExtensionEquals(const
ExtensionType& other) const {
permutation_equivalent;
}
+std::string FixedShapeTensorType::ToString() const {
+ std::stringstream ss;
+ ss << "extension<" << this->extension_name()
+ << "[value_type=" << value_type_->ToString() << ", shape=[";
+ std::string separator;
+ for (auto v : shape_) {
+ ss << separator << v;
+ separator = ",";
+ }
+ ss << "]";
+ if (!permutation_.empty()) {
+ ss << ", permutation=[";
+ std::string p_separator;
+ for (auto v : permutation_) {
+ ss << p_separator << v;
+ p_separator = ",";
+ }
+ ss << "]";
+ }
+ if (!dim_names_.empty()) {
+ ss << ", dim_names=[";
+ std::string d_separator;
+ for (std::string v : dim_names_) {
+ ss << d_separator << v;
+ d_separator = ",";
+ }
+ ss << "]";
+ }
+ ss << "]>";
+ return ss.str();
+}
+
Review Comment:
We even have another helper
[here](https://github.com/apache/arrow/blob/b9453a2a33e935e26dc8358846ad671aefdcb4d0/cpp/src/arrow/compute/function_internal.h#L176).
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]