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

Simplify comparing the result from inputstream #5452

Closed
JaySon-Huang opened this issue Jul 22, 2022 · 0 comments · Fixed by #5435
Closed

Simplify comparing the result from inputstream #5452

JaySon-Huang opened this issue Jul 22, 2022 · 0 comments · Fixed by #5435
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Jul 22, 2022

Enhancement

When comparing the result read from an inputstream, we write lots of redunt codes to locate the column, summing the num of rows, ensuring readPrefix/readSuffix, etc.
That is verbose and easy to forget.

#5371 (comment)

We can introduce a macro for tests, which is more simple and intuitive.

 ASSERT_INPUTSTREAM_COLS_UR( 
     stream, 
     /* column_names = */Strings({DMTestEnv::pk_name, col_name_c1, col_name_to_add}), 
     /* columns = */createColumns({ 
         createColumn<Int64>(createNumbers<Int64>(0, num_rows_write)), 
         createColumn<Int8>(createSignedNumbers(0, num_rows_write)), 
         createColumn<Int32>(std::vector<Int64>(num_rows_write, 0)), 
     })); 
@JaySon-Huang JaySon-Huang added the type/enhancement The issue or PR belongs to an enhancement. label Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant