andishgar commented on code in PR #47586:
URL: https://github.com/apache/arrow/pull/47586#discussion_r2426562396
##########
cpp/src/arrow/tensor/csx_converter.cc:
##########
@@ -150,8 +143,9 @@ Status
MakeSparseCSXMatrixFromTensor(SparseMatrixCompressedAxis axis,
std::shared_ptr<SparseIndex>*
out_sparse_index,
std::shared_ptr<Buffer>* out_data) {
SparseCSXMatrixConverter converter(axis, tensor, index_value_type, pool);
- RETURN_NOT_OK(converter.Convert());
-
+ ConverterVisitor visitor(converter);
+ ARROW_RETURN_NOT_OK(
+ util::VisitCSXType(*tensor.type(), *index_value_type, *index_value_type,
visitor));
Review Comment:
Yes, but since I use the same logic to visit these types and determine their
type in two places—and as I suggested
[here](https://github.com/apache/arrow/pull/47586#issuecomment-3391572685), we
should also apply it for tensor building—I decided to create an interface to
avoid a lot of repetitive code.
Given these reasons, would you recommend using `VisitTypeInline`?
--
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]