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


##########
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:
   > How about making the existing API deprecated, keeping backward 
compatibility and creating a new API for now? > (We can do this in a separated 
PR.)
   > We can remove the deprecated existing API later.
   
   I took a closer look, and the `GetRegisteredFunctionSignatures` API could be 
kept easily without breaking compatibility, however, it is not easy to keep the 
iterator API of `FunctionRegistry` compatible while not making its internals 
too complicated. I may give it a try in a separated PR if I figure out a clean 
way to do it.



-- 
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