You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/11/30 14:01:13 UTC
[GitHub] [arrow] aocsa commented on a change in pull request #11798: ARROW-7051: [C++] Improve MakeArrayOfNull to support creation of multiple arrays
aocsa commented on a change in pull request #11798:
URL: https://github.com/apache/arrow/pull/11798#discussion_r759282058
##########
File path: cpp/src/arrow/compute/kernels/util_internal.cc
##########
@@ -77,6 +77,41 @@ ArrayKernelExec TrivialScalarUnaryAsArraysExec(ArrayKernelExec exec,
};
}
+Result<std::shared_ptr<Array>> CreateEmptyArray(std::shared_ptr<DataType> type,
+ MemoryPool* memory_pool) {
+ std::unique_ptr<ArrayBuilder> builder;
+ RETURN_NOT_OK(MakeBuilder(memory_pool, type, &builder));
+ RETURN_NOT_OK(builder->Resize(0));
+ return builder->Finish();
+}
+
+Result<std::shared_ptr<ChunkedArray>> CreateEmptyChunkedArray(
+ std::shared_ptr<DataType> type, MemoryPool* memory_pool) {
+ std::vector<std::shared_ptr<Array>> new_chunks(1); // Hard-coded 1 for now
Review comment:
This comment is not needed anymore
##########
File path: cpp/src/arrow/compute/kernels/util_internal.h
##########
@@ -161,6 +164,21 @@ int64_t CopyNonNullValues(const Datum& datum, T* out) {
return n;
}
+//--------------------------------------------------------------------------
+// An internal function to create an empty array, chucked array, record batch and table.
+
Review comment:
Try to improve documentation of these utilify functions here and use the same code style for documentation and add specific documentation for each function, See example here https://github.com/apache/arrow/blob/41df46e3106847f81ba032e219c2854df11bbd45/cpp/src/arrow/compute/api_vector.h#L249
Try to add some context, for example functions that would use these functions, where they would be need to use, and in general why they need to be in the utility functions.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org