okadakk commented on a change in pull request #11298:
URL: https://github.com/apache/arrow/pull/11298#discussion_r742544977
##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -672,11 +678,64 @@ struct Utf8TitleTransform : public
FunctionalCaseMappingTransform {
template <typename Type>
using Utf8Title = StringTransformExec<Type, Utf8TitleTransform>;
+struct Utf8NormalizeTransform : public FunctionalCaseMappingTransform {
+ using State = OptionsWrapper<Utf8NormalizeOptions>;
+
+ const Utf8NormalizeOptions* options;
+
+ explicit Utf8NormalizeTransform(const Utf8NormalizeOptions& options)
+ : options{&options} {}
+
+ int64_t MaxCodeunits(const uint8_t* input, int64_t ninputs,
+ int64_t input_ncodeunits) override {
+ const auto option = GenerateUtf8NormalizeOption(options->method);
Review comment:
Thanks for Advice!
I'm wondering how to fix it.
If I fix according to the advice, It need to add code to api_scalar.h like
this.
```
#ifdef ARROW_WITH_UTF8PROC
#include <utf8proc.h>
#endif
```
#ifdef ARROW_WITH_UTF8PROC
struct ARROW_EXPORT Utf8NormalizeOptions : public FunctionOptions {
Utf8NormalizeOptions(utf8proc_option_t utf8proc_form) {
...
}
}
#endif
```
But including utf8proc in the public header is not a good solution, right?
Could you give me a hint?
##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -672,11 +678,64 @@ struct Utf8TitleTransform : public
FunctionalCaseMappingTransform {
template <typename Type>
using Utf8Title = StringTransformExec<Type, Utf8TitleTransform>;
+struct Utf8NormalizeTransform : public FunctionalCaseMappingTransform {
+ using State = OptionsWrapper<Utf8NormalizeOptions>;
+
+ const Utf8NormalizeOptions* options;
+
+ explicit Utf8NormalizeTransform(const Utf8NormalizeOptions& options)
+ : options{&options} {}
+
+ int64_t MaxCodeunits(const uint8_t* input, int64_t ninputs,
+ int64_t input_ncodeunits) override {
+ const auto option = GenerateUtf8NormalizeOption(options->method);
Review comment:
Thanks for Advice!
I'm wondering how to fix it.
If I fix according to the advice, It need to add code to api_scalar.h like
this.
```
#ifdef ARROW_WITH_UTF8PROC
#include <utf8proc.h>
#endif
#ifdef ARROW_WITH_UTF8PROC
struct ARROW_EXPORT Utf8NormalizeOptions : public FunctionOptions {
Utf8NormalizeOptions(utf8proc_option_t utf8proc_form) {
...
}
}
#endif
```
But including utf8proc in the public header is not a good solution, right?
Could you give me a hint?
--
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]