@@ -27,19 +27,6 @@ namespace arrow {
2727
2828namespace {
2929
30- template <typename T>
31- struct SparseIndexTraits {};
32-
33- template <>
34- struct SparseIndexTraits <SparseCOOIndex> {
35- static inline const char * name () { return " SparseCOOIndex" ; }
36- };
37-
38- template <>
39- struct SparseIndexTraits <SparseCSRIndex> {
40- static inline const char * name () { return " SparseCSRIndex" ; }
41- };
42-
4330// ----------------------------------------------------------------------
4431// SparseTensorConverter
4532
@@ -49,9 +36,7 @@ class SparseTensorConverter {
4936 explicit SparseTensorConverter (const NumericTensor<TYPE>&) {}
5037
5138 Status Convert () {
52- std::string sparse_index_name (SparseIndexTraits<SparseIndexType>::name ());
53- return Status::NotImplemented (sparse_index_name +
54- std::string (" is not supported yet." ));
39+ return Status::Invalid (" Unsupported sparse index" );
5540 }
5641};
5742
@@ -303,7 +288,7 @@ INSTANTIATE_SPARSE_TENSOR_CONVERTER(SparseCSRIndex);
303288
304289// Constructor with a column-major NumericTensor
305290SparseCOOIndex::SparseCOOIndex (const std::shared_ptr<CoordsTensor>& coords)
306- : SparseIndex(coords->shape ()[0]), coords_(coords) {
291+ : SparseIndex(SparseIndex::COO, coords->shape ()[0]), coords_(coords) {
307292 DCHECK (coords_->is_column_major ());
308293}
309294
@@ -313,7 +298,7 @@ SparseCOOIndex::SparseCOOIndex(const std::shared_ptr<CoordsTensor>& coords)
313298// Constructor with two index vectors
314299SparseCSRIndex::SparseCSRIndex (const std::shared_ptr<IndexTensor>& indptr,
315300 const std::shared_ptr<IndexTensor>& indices)
316- : SparseIndex(indices->shape ()[0]), indptr_(indptr), indices_(indices) {
301+ : SparseIndex(SparseIndex::CSR, indices->shape ()[0]), indptr_(indptr), indices_(indices) {
317302 DCHECK_EQ (1 , indptr_->ndim ());
318303 DCHECK_EQ (1 , indices_->ndim ());
319304}
0 commit comments