felipecrv commented on code in PR #35565:
URL: https://github.com/apache/arrow/pull/35565#discussion_r1201293390


##########
cpp/src/arrow/acero/source_node.cc:
##########
@@ -143,8 +143,14 @@ struct SourceNode : ExecNode, public TracedNode {
               batch_size = morsel_length;
             }
             ExecBatch batch = morsel.Slice(offset, batch_size);
-            UnalignedBufferHandling unaligned_buffer_handling =
+            std::optional<UnalignedBufferHandling> 
opt_unaligned_buffer_handling =
                 plan_->query_context()->options().unaligned_buffer_handling;
+            UnalignedBufferHandling unaligned_buffer_handling;
+            if (opt_unaligned_buffer_handling.has_value()) {
+              unaligned_buffer_handling = *opt_unaligned_buffer_handling;
+            } else {
+              unaligned_buffer_handling = GetDefaultUnalignedBufferHandling();
+            }

Review Comment:
   ternary use maybe?
   
   ```cpp
   auto unaligned_buffer_handling = opt_unaligned_buffer_handling.has_value() ?
         *opt_unaligned_buffer_handling : 
         GetDefaultUnalignedBufferHandling();
   ```



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