Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37643: [C++] Enhance arrow::Datum::ToString #37646

Merged
merged 3 commits into from
Sep 15, 2023

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Sep 11, 2023

Rationale for this change

Add print child fields for arrow::Datum::ToString. Because previously it just print a type.

What changes are included in this PR?

Add detail in arrow::Datum::ToString

Are these changes tested?

no

Are there any user-facing changes?

Yes

@github-actions
Copy link

⚠️ GitHub issue #37643 has been automatically assigned in GitHub to PR creator.

case Datum::ARRAY:
return "Array";
return "Array(" + make_array()->ToString() + ")";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make_array will generate a temp ::arrow::Array object, don't know if we have a better way for this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I don't think so. It won't be an O(N) copy or anything though, so not the end of the world.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 11, 2023
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Sep 11, 2023
@mapleFU
Copy link
Member Author

mapleFU commented Sep 11, 2023

/arrow/c_glib/test/test-table-datum.rb:52:in `test_to_string'
     49:   end
     50: 
     51:   def test_to_string
  => 52:     assert_equal("Table", @datum.to_s)
     53:   end
     54: 
     55:   def test_value
<"Table"> expected but was
<"Table(visible: bool\n" +
"----\n" +
"visible:\n" +
"  [\n" +
"    [\n" +
"      true,\n" +
"      false\n" +
"    ]\n" +
"  ]\n" +
")">

Seems this should also be fixed lol

@github-actions github-actions bot added Component: GLib awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 14, 2023
@mapleFU mapleFU marked this pull request as ready for review September 15, 2023 10:10
@mapleFU mapleFU requested a review from kou as a code owner September 15, 2023 10:10
@mapleFU
Copy link
Member Author

mapleFU commented Sep 15, 2023

@bkietz @kou Would you mind take a look?

Copy link
Member

@bkietz bkietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Sep 15, 2023
@bkietz bkietz merged commit d9ee3a7 into apache:main Sep 15, 2023
@bkietz bkietz removed the awaiting merge Awaiting merge label Sep 15, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit d9ee3a7.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details.

@mapleFU mapleFU deleted the datum-to-string branch September 19, 2023 17:03
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
### Rationale for this change

Add print child fields for `arrow::Datum::ToString`. Because previously it just print a type.

### What changes are included in this PR?

Add detail in `arrow::Datum::ToString`

### Are these changes tested?

no

### Are there any user-facing changes?

Yes

* Closes: apache#37643

Authored-by: mwish <[email protected]>
Signed-off-by: Benjamin Kietzman <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
### Rationale for this change

Add print child fields for `arrow::Datum::ToString`. Because previously it just print a type.

### What changes are included in this PR?

Add detail in `arrow::Datum::ToString`

### Are these changes tested?

no

### Are there any user-facing changes?

Yes

* Closes: apache#37643

Authored-by: mwish <[email protected]>
Signed-off-by: Benjamin Kietzman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Enhance arrow::Datum::ToString
2 participants