You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/08 06:18:27 UTC

[GitHub] [arrow] rtpsw commented on a diff in pull request #14348: ARROW-17965: [C++] ExecBatch support for ChunkedArray values

rtpsw commented on code in PR #14348:
URL: https://github.com/apache/arrow/pull/14348#discussion_r990597511


##########
cpp/src/arrow/compute/exec.cc:
##########
@@ -90,14 +90,29 @@ void PrintTo(const ExecBatch& batch, std::ostream* os) {
     if (value.is_scalar()) {
       *os << "Scalar[" << value.scalar()->ToString() << "]\n";
       continue;
+    } else if (value.is_array() || value.is_chunked_array()) {
+      PrettyPrintOptions options;
+      options.skip_new_lines = true;
+      if (value.is_array()) {
+        auto array = value.make_array();
+        *os << "Array";
+        ARROW_CHECK_OK(PrettyPrint(*array, options, os));
+      } else {
+        auto array = value.chunked_array();
+        *os << "Chunked Array";
+        ARROW_CHECK_OK(PrettyPrint(*array, options, os));
+      }
+      *os << "\n";
+    } else if (value.is_chunked_array()) {

Review Comment:
   Yes, this is an oversight. Will remove.



##########
cpp/src/arrow/compute/exec.cc:
##########
@@ -90,14 +90,29 @@ void PrintTo(const ExecBatch& batch, std::ostream* os) {
     if (value.is_scalar()) {
       *os << "Scalar[" << value.scalar()->ToString() << "]\n";
       continue;

Review Comment:
   You mean remove the `continue` statement? I suppose we could.



##########
cpp/src/arrow/compute/exec.cc:
##########
@@ -118,8 +133,15 @@ std::string ExecBatch::ToString() const {
 ExecBatch ExecBatch::Slice(int64_t offset, int64_t length) const {
   ExecBatch out = *this;
   for (auto& value : out.values) {
-    if (value.is_scalar()) continue;
-    value = value.array()->Slice(offset, length);
+    if (value.is_scalar()) {
+      continue;

Review Comment:
   You mean remove the `continue` statement? I suppose we could.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org