Skip to content

Commit

Permalink
Don't include length and offset when pretty-printing REE
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrv committed Jan 23, 2023
1 parent 5f9cee8 commit 4be0ed1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/array/array_run_end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
ASSERT_OK(PrettyPrint(*int_array, {}, &ss));
ASSERT_EQ(ss.str(),
"\n"
"-- run ends array (offset: 0, logical length: 30)\n"
"-- run_ends:\n"
" [\n"
" 10,\n"
" 20,\n"
Expand All @@ -490,7 +490,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
ASSERT_OK(PrettyPrint(*string_array, {}, &ss));
ASSERT_EQ(ss.str(),
"\n"
"-- run ends array (offset: 0, logical length: 30)\n"
"-- run_ends:\n"
" [\n"
" 10,\n"
" 20,\n"
Expand All @@ -508,7 +508,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
ASSERT_OK(PrettyPrint(*sliced_array, {}, &ss));
ASSERT_EQ(ss.str(),
"\n"
"-- run ends array (offset: 15, logical length: 6)\n"
"-- run_ends:\n"
" [\n"
" 10,\n"
" 20,\n"
Expand All @@ -529,7 +529,7 @@ TEST_P(TestRunEndEncodedArray, Printing) {
ASSERT_OK(PrettyPrint(*empty_array, {}, &ss));
ASSERT_EQ(ss.str(),
"\n"
"-- run ends array (offset: 0, logical length: 0)\n"
"-- run_ends:\n"
" []\n"
"-- values:\n"
" []");
Expand Down
6 changes: 1 addition & 5 deletions cpp/src/arrow/pretty_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,7 @@ class ArrayPrinter : public PrettyPrinter {
Status Visit(const RunEndEncodedArray& array) {
Newline();
Indent();
Write("-- run ends array (offset: ");
Write(std::to_string(array.offset()));
Write(", logical length: ");
Write(std::to_string(array.length()));
Write(")\n");
Write("-- run_ends:\n");
RETURN_NOT_OK(PrettyPrint(*array.run_ends_array(), ChildOptions(true), sink_));

Newline();
Expand Down

0 comments on commit 4be0ed1

Please sign in to comment.