-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-4225: [Format][C++] Add CSC sparse matrix support #5932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f113a35 to
a148df6
Compare
wesm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The high level / public API details look OK to me at a glance. I don't have time to scrutinize the implementation -- not sure if someone else wants to take a closer look
rok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I like the CSR and CSC index type unification.
Some minor comments. Someone with more experience should also take a look.
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mrkn. Here are some comments.
cpp/src/arrow/sparse_tensor.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, make this kTypeName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Should I also rename format_id to kFormatId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Our current convention would be to keep format_id. I'm not sure about kTypeName vs. type_name, TBH. But it definitely shouldn't be all-uppercase TYPE_NAME.
@wesm thoughts?
2397c1a to
3dc96fb
Compare
|
The failure on CI isn't due to this PR. |
| ++num_csr; | ||
| break; | ||
| case SparseTensorFormat::CSC: | ||
| // TODO(mrkn): support csc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open a JIRA for this, if not already done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I forgot to do it.
Filed https://issues.apache.org/jira/browse/ARROW-7419.
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "TODO for ndim <= 1" comment needs a decision, otherwise LGTM.
|
Thank you @mrkn! |
|
Thanks @mrkn! |
I'd like to add CSC sparse matrix support in format and C++ API.
This pull-request changes both format and C++ API.
The changes in format are below:
compressedAxisis added toSparseMatrixIndexCSRtable; this field used to distinguish CSR and CSCSparseMatrixIndexCSRis renamed toSparseMatrixIndexCSXThe changes in C++ API are below:
SparseCSCIndexclass is added as a subclass ofinternal::SparseCSXIndexinternal::SparseCSXIndexclass is added as a superclass ofSparseCSRIndexandSparseCSCIndexclassesSparseCSCMatrixclass is added as an alias toSparseTensorImpl<SparseCSCIndex>classReadSparseTensorsupports readingSparseCSCMatrixclass