andishgar commented on code in PR #47586:
URL: https://github.com/apache/arrow/pull/47586#discussion_r2368901681


##########
cpp/src/arrow/tensor/coo_converter.cc:
##########
@@ -25,46 +25,48 @@
 
 #include "arrow/buffer.h"
 #include "arrow/status.h"
+#include "arrow/tensor.h"
 #include "arrow/type.h"
 #include "arrow/util/checked_cast.h"
 #include "arrow/util/macros.h"
-#include "arrow/visit_type_inline.h"
 
 namespace arrow {
 
 class MemoryPool;
 
 namespace internal {
+
 namespace {
 
-template <typename c_index_type>
-inline void IncrementRowMajorIndex(std::vector<c_index_type>& coord,
+template <typename IndexCType>
+inline void IncrementRowMajorIndex(std::vector<IndexCType>& coord,
                                    const std::vector<int64_t>& shape) {
   const int64_t ndim = shape.size();
   ++coord[ndim - 1];
-  if (coord[ndim - 1] == shape[ndim - 1]) {
+  if (static_cast<int64_t>(coord[ndim - 1]) == shape[ndim - 1]) {
     int64_t d = ndim - 1;
-    while (d > 0 && coord[d] == shape[d]) {
+    while (d > 0 && static_cast<int64_t>(coord[d]) == shape[d]) {
       coord[d] = 0;
       ++coord[d - 1];
       --d;
     }
   }
 }
 
-template <typename c_index_type, typename c_value_type>
-void ConvertRowMajorTensor(const Tensor& tensor, c_index_type* indices,
-                           c_value_type* values, const int64_t size) {
+template <typename IndexType, typename ValueType>
+void ConvertContinuousTensor(const Tensor& tensor, typename IndexType::c_type* 
indices,
+                             typename ValueType::c_type* values) {
+  using ValueCType = typename ValueType::c_type;
+  using IndexCType = typename IndexType::c_type;

Review Comment:
   Yes, this is related to Column Major issue and more works should it be done. 
I will revert it in this pr and apply it again in its own 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to