pitrou commented on code in PR #38116:
URL: https://github.com/apache/arrow/pull/38116#discussion_r1367748106
##########
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:
Well, we can keep the `GetRegisteredFunctionSignatures` API as-is but still
redefine `begin()` and `end()` if we want.
The question is whether some people rely on the fact that `begin()` and
`end()` return a pointer, rather than a more general bidirectional iterator.
That would be slight weird IMHO.
That said, I think it's also ok for now to pre-allocate the vector to
workaround this problem.
--
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]