| 82 | } |
| 83 | |
| 84 | void PrintTo(const ExecBatch& batch, std::ostream* os) { |
| 85 | *os << "ExecBatch\n"; |
| 86 | |
| 87 | static const std::string indent = " "; |
| 88 | |
| 89 | *os << indent << "# Rows: " << batch.length << "\n"; |
| 90 | if (batch.guarantee != literal(true)) { |
| 91 | *os << indent << "Guarantee: " << batch.guarantee.ToString() << "\n"; |
| 92 | } |
| 93 | |
| 94 | int i = 0; |
| 95 | for (const Datum& value : batch.values) { |
| 96 | *os << indent << "" << i++ << ": "; |
| 97 | |
| 98 | if (value.is_scalar()) { |
| 99 | *os << "Scalar[" << value.scalar()->ToString() << "]\n"; |
| 100 | } else if (value.is_array() || value.is_chunked_array()) { |
| 101 | PrettyPrintOptions options; |
| 102 | options.skip_new_lines = true; |
| 103 | if (value.is_array()) { |
| 104 | auto array = value.make_array(); |
| 105 | *os << "Array"; |
| 106 | ARROW_CHECK_OK(PrettyPrint(*array, options, os)); |
| 107 | } else { |
| 108 | auto array = value.chunked_array(); |
| 109 | *os << "Chunked Array"; |
| 110 | ARROW_CHECK_OK(PrettyPrint(*array, options, os)); |
| 111 | } |
| 112 | *os << "\n"; |
| 113 | } else { |
| 114 | ARROW_DCHECK(false); |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | int64_t ExecBatch::TotalBufferSize() const { |
| 120 | int64_t sum = 0; |
no test coverage detected