pitrou commented on code in PR #41561:
URL: https://github.com/apache/arrow/pull/41561#discussion_r1599923587
##########
cpp/src/arrow/chunk_resolver.h:
##########
@@ -36,8 +39,42 @@ struct ChunkLocation {
/// \brief Index of the value in the chunk
///
- /// The value is undefined if chunk_index >= chunks.size()
+ /// The value is UNDEFINED if chunk_index >= chunks.size()
int64_t index_in_chunk = 0;
+
+ /// \brief Create a ChunkLocation without asserting any preconditions.
+ static ChunkLocation Forge(int64_t chunk_index, int64_t index_in_chunk) {
+ ChunkLocation loc;
+ loc.chunk_index = chunk_index;
+ loc.index_in_chunk = index_in_chunk;
+ return loc;
+ }
+
+ ChunkLocation() = default;
+
+ public:
+ template <class ChunkResolver>
+ ChunkLocation(const ChunkResolver& resolver, int64_t chunk_index,
+ int64_t index_in_chunk)
+ : chunk_index(chunk_index), index_in_chunk(index_in_chunk) {
Review Comment:
In which context do we want to produce a `ChunkLocation` out of arbitrary
integers.
##########
cpp/src/arrow/chunk_resolver.h:
##########
@@ -36,8 +39,42 @@ struct ChunkLocation {
/// \brief Index of the value in the chunk
///
- /// The value is undefined if chunk_index >= chunks.size()
+ /// The value is UNDEFINED if chunk_index >= chunks.size()
int64_t index_in_chunk = 0;
+
+ /// \brief Create a ChunkLocation without asserting any preconditions.
+ static ChunkLocation Forge(int64_t chunk_index, int64_t index_in_chunk) {
+ ChunkLocation loc;
+ loc.chunk_index = chunk_index;
+ loc.index_in_chunk = index_in_chunk;
+ return loc;
+ }
+
+ ChunkLocation() = default;
+
+ public:
+ template <class ChunkResolver>
+ ChunkLocation(const ChunkResolver& resolver, int64_t chunk_index,
+ int64_t index_in_chunk)
+ : chunk_index(chunk_index), index_in_chunk(index_in_chunk) {
Review Comment:
In which context do we want to produce a `ChunkLocation` out of arbitrary
integers?
--
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]