-
Notifications
You must be signed in to change notification settings - Fork 70
add Status data structure #8
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
|
Also @zhjwpku can you make sure you proof-read your PR description? There are spell checkers that can help. |
Sorry about the inconvenience, will be careful in the future. |
|
I think this PR makes too much assumptions that we will go with everything that the Arrow community chose. For instance this seems to decide the "exceptions vs status codes" question. Also decides which test framework to use, and additionally pulls in a number of macros too. I myself planned to come up with the headers for basic classes like Catalog Table and such, but I'd personally prefer exceptions over status codes for many reasons. Method chaining is something I find really powerful in the Java implementation but with status codes you wouldn't be able to do that if you have to check the status for every function call. Not to mention that constantly checking for statuses would make the code less readable. Also Statuses would make the parameter list longer, not to mention that lines would be longer (which somewhat matters now that we went for 90 chars). Long story short I'm -1 for this PR. |
This PR is not trying to decide which test framework to use, I have started a issue #12 where we can discuss the test framework. |
I have seen some use cases of Method chaining in C++ world, mostly people use it for constructing object I guess. Can you elaborate how we can use it with exception to make the apis easy to use? I don't like method chaining, it makes debug more difficult, when you set a breakpoint on the method chain and exception happens, how do you know which call give out the exception? I think it's generally good practice to always write very short and concise lines. Every line should just make one method call. There is an old stackoverflow question which I think we can take a look, Method chaining (fluent interfacing) - why is it a good practice, or not? |
I did a quick run through on this PR and my general opinion is this: This PR assumes that we simply want to pull in auxiliary stuff from the Arrow project and without questioning whether we'd need them here or not we just pull entire files into this project. This is pretty difficult to review TBH, and if someone is not from the Arrow project it's even more difficult because they have to figure out the initial motivation of each functionality of another project. I think this should be the other way around. Let's identify some functionality that we'd like to develop in this project, like interface for catalogs let's say, and if we find something in other projects that could help then pull in only the required part. Or let's have a very simple implementation ourselves, we can still evolve it later on. |
|
I agree with @gaborkaszab that it would be better to discuss a concrete API design (e.g. Table, FileIO, etc.) before introducing a full-functional status implementation. If we decide to go with status over exception, we can add a basic status class at first and make it powerful later on. |
Agreed, maybe we should schedule a sync meeting to discuss some of the issues. |
1319f52 to
fe5cbbf
Compare
|
I'm a bit late here but even if we want to use Status/Result, it may be better to go with a backport of std::expected to at least try to align with the STL. Ah sorry, I see discussion moved to #14. |
|
@lidavidm I was about to reply to this thread to revive the discussion :) |
No worry, I totally agree your suggestion, I will work on this way in the following days. |
|
I have used this before: https://github.com/TartanLlama/expected I think my main complaint (this applies to Arrow too) is that the structure is a bit opaque in a debugger. Arrow ended up writing a GDB pretty printer script. |
fe5cbbf to
534d64f
Compare
Adpated from Apache Arrow with lot of simplification. Signed-off-by: Junwang Zhao <[email protected]>
534d64f to
d53e446
Compare
Co-authored-by: Raúl Cumplido <[email protected]>
|
This is obsoleted by #40, though we haven't decided to adopt expected or not, this PR can be closed. Thanks for all the inputs. |
This is adapted from Apache Arrow, which a pre-step before integrating the Result data structure.