kou commented on code in PR #14348:
URL: https://github.com/apache/arrow/pull/14348#discussion_r990515005
##########
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:
Duplicated condition?
##########
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:
Should we replace this with `// Do nothing` or something?
##########
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:
Should we remove this?
--
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]