pitrou commented on code in PR #38116:
URL: https://github.com/apache/arrow/pull/38116#discussion_r1369983101


##########
cpp/src/gandiva/function_registry.cc:
##########
@@ -16,18 +16,23 @@
 // under the License.
 
 #include "gandiva/function_registry.h"
+
+#include <iterator>
+#include <utility>
+#include <vector>
+
+#include "arrow/util/logging.h"
 #include "gandiva/function_registry_arithmetic.h"
 #include "gandiva/function_registry_datetime.h"
 #include "gandiva/function_registry_hash.h"
 #include "gandiva/function_registry_math_ops.h"
 #include "gandiva/function_registry_string.h"
 #include "gandiva/function_registry_timestamp_arithmetic.h"
 
-#include <iterator>
-#include <utility>
-#include <vector>
-
 namespace gandiva {
+constexpr uint32_t kMaxFunctionSignatures = 2048;
+
+FunctionRegistry::FunctionRegistry() { 
pc_registry_.reserve(kMaxFunctionSignatures); }
 
 FunctionRegistry::iterator FunctionRegistry::begin() const {

Review Comment:
   The iterator API doesn't look very useful either, so I'm not sure it's worth 
trying to emulate it. Why would someone iterate over registered functions one 
by one?
   
   We could simply expose an API returning a `std::vector` of the registered 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to