File indexing completed on 2025-08-27 08:47:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #pragma once
0019
0020 #include <iosfwd>
0021 #include <string>
0022 #include <utility>
0023
0024 #include "arrow/util/visibility.h"
0025
0026 namespace arrow {
0027
0028 class Array;
0029 class ChunkedArray;
0030 class RecordBatch;
0031 class Schema;
0032 class Status;
0033 class Table;
0034
0035
0036
0037
0038 struct ARROW_EXPORT PrettyPrintDelimiters {
0039
0040 std::string open = "[";
0041
0042
0043 std::string close = "]";
0044
0045
0046
0047 std::string element = ",";
0048
0049
0050 static PrettyPrintDelimiters Defaults() { return PrettyPrintDelimiters(); }
0051 };
0052
0053
0054
0055 struct ARROW_EXPORT PrettyPrintOptions {
0056 PrettyPrintOptions() = default;
0057
0058 PrettyPrintOptions(int indent,
0059 int window = 10, int indent_size = 2, std::string null_rep = "null",
0060 bool skip_new_lines = false, bool truncate_metadata = true,
0061 int container_window = 2)
0062 : indent(indent),
0063 indent_size(indent_size),
0064 window(window),
0065 container_window(container_window),
0066 null_rep(std::move(null_rep)),
0067 skip_new_lines(skip_new_lines),
0068 truncate_metadata(truncate_metadata) {}
0069
0070
0071 static PrettyPrintOptions Defaults() { return PrettyPrintOptions(); }
0072
0073
0074 int indent = 0;
0075
0076
0077 int indent_size = 2;
0078
0079
0080 int window = 10;
0081
0082
0083
0084 int container_window = 2;
0085
0086
0087 std::string null_rep = "null";
0088
0089
0090 bool skip_new_lines = false;
0091
0092
0093
0094 bool truncate_metadata = true;
0095
0096
0097 bool show_field_metadata = true;
0098
0099
0100 bool show_schema_metadata = true;
0101
0102
0103 PrettyPrintDelimiters array_delimiters = PrettyPrintDelimiters::Defaults();
0104
0105
0106 PrettyPrintDelimiters chunked_array_delimiters = PrettyPrintDelimiters::Defaults();
0107 };
0108
0109
0110 ARROW_EXPORT
0111 Status PrettyPrint(const RecordBatch& batch, int indent, std::ostream* sink);
0112
0113 ARROW_EXPORT
0114 Status PrettyPrint(const RecordBatch& batch, const PrettyPrintOptions& options,
0115 std::ostream* sink);
0116
0117
0118 ARROW_EXPORT
0119 Status PrettyPrint(const Table& table, const PrettyPrintOptions& options,
0120 std::ostream* sink);
0121
0122
0123 ARROW_EXPORT
0124 Status PrettyPrint(const Array& arr, int indent, std::ostream* sink);
0125
0126
0127 ARROW_EXPORT
0128 Status PrettyPrint(const Array& arr, const PrettyPrintOptions& options,
0129 std::ostream* sink);
0130
0131
0132 ARROW_EXPORT
0133 Status PrettyPrint(const Array& arr, const PrettyPrintOptions& options,
0134 std::string* result);
0135
0136
0137 ARROW_EXPORT
0138 Status PrettyPrint(const ChunkedArray& chunked_arr, const PrettyPrintOptions& options,
0139 std::ostream* sink);
0140
0141
0142 ARROW_EXPORT
0143 Status PrettyPrint(const ChunkedArray& chunked_arr, const PrettyPrintOptions& options,
0144 std::string* result);
0145
0146 ARROW_EXPORT
0147 Status PrettyPrint(const Schema& schema, const PrettyPrintOptions& options,
0148 std::ostream* sink);
0149
0150 ARROW_EXPORT
0151 Status PrettyPrint(const Schema& schema, const PrettyPrintOptions& options,
0152 std::string* result);
0153
0154 ARROW_EXPORT
0155 Status DebugPrint(const Array& arr, int indent);
0156
0157 }