edponce commented on a change in pull request #10869:
URL: https://github.com/apache/arrow/pull/10869#discussion_r698429390



##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -496,29 +493,22 @@ template <typename Type>
 using UTF8SwapCase =
     StringTransformExec<Type, StringTransformCodepoint<UTF8SwapCaseTransform>>;
 
-struct Utf8CapitalizeTransform : public StringTransformBase {
+struct Utf8CapitalizeTransform : public StringTransformCodepointBase {
   int64_t Transform(const uint8_t* input, int64_t input_string_ncodeunits,
                     uint8_t* output) {
     uint8_t* output_start = output;
-    if (input_string_ncodeunits > 0) {

Review comment:
       I added the check, it should be there. I argue that this check should be 
done before invoking `Transform` so that all kernels always expect some input. 
But this is another suggestion to tacke later.

##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -496,29 +493,22 @@ template <typename Type>
 using UTF8SwapCase =
     StringTransformExec<Type, StringTransformCodepoint<UTF8SwapCaseTransform>>;
 
-struct Utf8CapitalizeTransform : public StringTransformBase {
+struct Utf8CapitalizeTransform : public StringTransformCodepointBase {
   int64_t Transform(const uint8_t* input, int64_t input_string_ncodeunits,
                     uint8_t* output) {
     uint8_t* output_start = output;
-    if (input_string_ncodeunits > 0) {

Review comment:
       I added the check, it should be there. I argue that this check should be 
done before invoking `Transform` so that all kernels always expect some input. 
But this is another suggestion to tackle later.




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