edponce edited a comment on pull request #12036:
URL: https://github.com/apache/arrow/pull/12036#issuecomment-1002242875
I think the inconsistency wrt visibility and validation in constructors and
`XXX::Make()` is a more general design topic to revisit than simply looking at
ChunkedArray.
| Data structure | Immutable? | Constructor visibility | Has `::Make()`? |
Comments |
| -------------- | ------------ | --------------------- | --------------- |
----------- |
| Table | Yes | protected |
Yes | |
| RecordBatch | Yes | protected | Yes
| |
| ChunkedArray | Yes | public | Yes
| `std::make_shared<ChunkedArray>` is used a lot |
| Array (base) | Yes | protected | No
| there are `MakeArrayXXX` utils |
| Array (derived) | Yes | public | No
| |
| ArrayData | No | public |
Yes | |
| Buffer | No | public
| No | there are `AllocateBuffer` utils |
Notes:
* The data structures that do not have public constructors cannot be
instantiated via `std::make_shared<XXX>()` except in derived classes.
* In general, constructors only set data members and `XXX::Make()` perform
validations.
* There exists `Validation` functions for some of the data structures which
perform similar checks as in `XXX::Make()`.
--
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]