You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dhruv Vats (Jira)" <ji...@apache.org> on 2021/11/09 20:35:00 UTC
[jira] [Comment Edited] (ARROW-14641) [C++][Compute] Remove print
statements from unit tests
[ https://issues.apache.org/jira/browse/ARROW-14641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17441349#comment-17441349 ]
Dhruv Vats edited comment on ARROW-14641 at 11/9/21, 8:34 PM:
--------------------------------------------------------------
This is my first time interacting with Apache Jira, so I don't think I have those permissions.
Also, from what I understand, on [this|https://github.com/apache/arrow/blob/8b440d1b5df4a0e58bcaa422b83e6d6ff1213b5f/cpp/src/arrow/compute/exec/hash_join_node_test.cc#L1064] line, the following code:
{code:java}
std::cout << join_type_name << " " << key_cmp_str << " ";
key_types.Print();
std::cout << " payload_l: ";
payload_types[0].Print();
std::cout << " payload_r: ";
payload_types[1].Print();
std::cout << " num_rows_l = " << num_rows_l << " num_rows_r = " << num_rows_r
<< " batch size = " << batch_size
<< " parallel = " << (parallel ? "true" : "false");
std::cout << std::endl; {code}
Should turn in something like this:
{code:java}
ARROW_SCOPED_TRACE(join_type_name, " ",
key_cmp_str, " ",
key_types.Print());
ARROW_SCOPED_TRACE(" payload_l: ", payload_types[0].Print());
ARROW_SCOPED_TRACE(" payload_r: ", payload_types[1].Print());
ARROW_SCOPED_TRACE(" num_rows_l = ", num_rows_l,
" num_rows_r = ", num_rows_r,
" batch size = ", batch_size,
" parallel = ", (parallel ? "true" : "false"));{code}
right?
Also, the [Print()|https://github.com/apache/arrow/blob/8b440d1b5df4a0e58bcaa422b83e6d6ff1213b5f/cpp/src/arrow/compute/exec/hash_join_node_test.cc#L385] method uses the SCOPED_TRACE macro internally too.
was (Author: dhruv9vats):
This is my first time interacting with Apache Jira, so I don't think I have those permissions.
Also, from what I understand, on [this|https://github.com/apache/arrow/blob/8b440d1b5df4a0e58bcaa422b83e6d6ff1213b5f/cpp/src/arrow/compute/exec/hash_join_node_test.cc#L1064] line, the following code:
{code:java}
std::cout << join_type_name << " " << key_cmp_str << " ";
key_types.Print();
std::cout << " payload_l: ";
payload_types[0].Print();
std::cout << " payload_r: ";
payload_types[1].Print();
std::cout << " num_rows_l = " << num_rows_l << " num_rows_r = " << num_rows_r
<< " batch size = " << batch_size
<< " parallel = " << (parallel ? "true" : "false");
std::cout << std::endl; {code}
Should turn in something like this:
{code:java}
ARROW_SCOPED_TRACE(join_type_name, " ",
key_cmp_str, " ",
key_types.Print());
ARROW_SCOPED_TRACE(" payload_l: ", payload_types[0].Print());
ARROW_SCOPED_TRACE(" payload_r: ", payload_types[1].Print());
ARROW_SCOPED_TRACE(" num_rows_l = ", num_rows_l,
" num_rows_r = ", num_rows_r,
" batch size = ", batch_size,
" parallel = ", (parallel ? "true" : "false"));{code}
right?
> [C++][Compute] Remove print statements from unit tests
> ------------------------------------------------------
>
> Key: ARROW-14641
> URL: https://issues.apache.org/jira/browse/ARROW-14641
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Affects Versions: 6.0.0
> Reporter: Ben Kietzman
> Priority: Major
> Labels: beginner-friendly
> Fix For: 7.0.0
>
>
> Unit tests should avoid unconditional print statements, preferring {{SCOPED_TRACE}}, {{ARROW_SCOPED_TRACE}}, or on-fail extra messages like {{ASSERT_EQ(1, 2) << "extra here";}}. There are some in the hash join unit tests
--
This message was sent by Atlassian Jira
(v8.20.1#820001)