Skip to content

Commit

Permalink
Add array_element_delimiter option to PrettyPrintOptions class.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Oct 2, 2023
1 parent 7667b81 commit d08fe8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/src/arrow/pretty_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,22 @@ class ArrayPrinter : public PrettyPrinter {
IndentAfterNewline();
(*sink_) << "...";
if (!is_last && options_.skip_new_lines) {
(*sink_) << ",";
(*sink_) << options_.array_element_delimiter;
}
i = array.length() - window - 1;
} else if (array.IsNull(i)) {
IndentAfterNewline();
(*sink_) << options_.null_rep;
if (!is_last) {
(*sink_) << ",";
(*sink_) << options_.array_element_delimiter;
}
} else {
if (indent_non_null_values) {
IndentAfterNewline();
}
RETURN_NOT_OK(func(i));
if (!is_last) {
(*sink_) << ",";
(*sink_) << options_.array_element_delimiter;
}
}
Newline();
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/pretty_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ struct PrettyPrintOptions {

/// If true, display schema metadata when pretty-printing a Schema
bool show_schema_metadata = true;

/// Delimiter for separating individual elements of an Array (e.g. ",")
std::string array_element_delimiter = ",";
};

/// \brief Print human-readable representation of RecordBatch
Expand Down

0 comments on commit d08fe8b

Please sign in to comment.