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

Test: support qualified column reference in writing tests #5614

Merged
merged 15 commits into from
Aug 16, 2022

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Aug 12, 2022

What problem does this PR solve?

Issue Number: close #5510

Problem Summary:

What is changed and how it works?

Modify qualified name into three parts, add a new struct to hold the column name.

struct ColumnName
{
    String db_name;
    String table_name;
    String column_name;
};

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Lloyd-Pottiger
  • SeaRise

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 12, 2022
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 12, 2022
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 12, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 12, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 12, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 12, 2022

/run-all-tests

@Willendless
Copy link
Contributor

/run-unit-test

@ywqzzy ywqzzy force-pushed the qualified_table_column_in_test branch from 665400c to 748210e Compare August 12, 2022 14:08
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 12, 2022

/run-unit-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 15, 2022

/run-all-tests

@@ -95,15 +95,15 @@ try

size_t task_size = tasks.size();
std::vector<String> executors = {
"exchange_sender_6 | type:Hash, {<0, String>}\n"
" table_scan_1 | {<0, String>}",
"exchange_sender_6 | type:Hash, {<0, String>, <1, String>}\n"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

because we can distinguish the column name by table_name and column_name, so the columnPrune result is different.

dbms/src/Flash/tests/gtest_executor.cpp Outdated Show resolved Hide resolved
dbms/src/Flash/tests/gtest_split_tasks.cpp Outdated Show resolved Hide resolved
dbms/src/Debug/dbgFuncCoprocessor.cpp Outdated Show resolved Hide resolved
dbms/src/Debug/dbgFuncCoprocessor.cpp Outdated Show resolved Hide resolved
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 15, 2022

/run-unit-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 15, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/astToExecutor.cpp                          575               134    76.70%          55                 3    94.55%        1550               359    76.84%         574               178    68.99%
Debug/astToExecutor.h                             30                 8    73.33%          22                 4    81.82%          48                12    75.00%           8                 5    37.50%
Debug/dbgFuncCoprocessor.cpp                     430               320    25.58%          39                27    30.77%         882               601    31.86%         292               220    24.66%
Flash/tests/gtest_compute_server.cpp              39                14    64.10%           3                 0   100.00%          70                 0   100.00%          12                 8    33.33%
Flash/tests/gtest_filter_executor.cpp             32                14    56.25%           3                 0   100.00%          47                 0   100.00%          10                 8    20.00%
Flash/tests/gtest_split_tasks.cpp                 43                14    67.44%           3                 0   100.00%         101                 0   100.00%          16                 8    50.00%
TestUtils/mockExecutor.cpp                        74                 3    95.95%          42                 1    97.62%         267                24    91.01%          36                 2    94.44%
TestUtils/tests/gtest_mock_executors.cpp         161                70    56.52%          11                 0   100.00%         278                 0   100.00%          40                40     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                           1384               577    58.31%         178                35    80.34%        3243               996    69.29%         988               469    52.53%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19256      9240             52.01%    219019  93929        57.11%

full coverage report (for internal network access only)

@ywqzzy ywqzzy requested a review from SeaRise August 15, 2022 06:26
request = left_builder.build(context);
{
String expected = "limit_8 | 10\n"
" Join_7 | LeftOuterJoin, HashJoin. left_join_keys: {<0, String>}, right_join_keys: {<0, String>}\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

why <0, String> or not <3, String>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why <0, String> or not <3, String>?

Related to executorSerializer.cpp:50, toString function print the column from index 0.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 15, 2022
@Willendless
Copy link
Contributor

According to the struct definition

struct ColumnName
{
    String db_name;
    String table_name;
    String column_name;
};

our qualified format seems to be "db_name.table_name.column_name", can you add some tests about this kind?

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 16, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 16, 2022

/run-unit-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 16, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/astToExecutor.cpp                          575               134    76.70%          55                 3    94.55%        1550               359    76.84%         574               178    68.99%
Debug/astToExecutor.h                             30                 8    73.33%          22                 4    81.82%          48                12    75.00%           8                 5    37.50%
Debug/dbgFuncCoprocessor.cpp                     430               320    25.58%          39                27    30.77%         882               601    31.86%         292               220    24.66%
Flash/tests/gtest_compute_server.cpp              39                14    64.10%           3                 0   100.00%          70                 0   100.00%          12                 8    33.33%
Flash/tests/gtest_filter_executor.cpp             32                14    56.25%           3                 0   100.00%          47                 0   100.00%          10                 8    20.00%
Flash/tests/gtest_split_tasks.cpp                 43                14    67.44%           3                 0   100.00%         101                 0   100.00%          16                 8    50.00%
TestUtils/mockExecutor.cpp                        74                 3    95.95%          42                 1    97.62%         267                24    91.01%          36                 2    94.44%
TestUtils/tests/gtest_mock_executors.cpp         161                70    56.52%          11                 0   100.00%         278                 0   100.00%          40                40     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                           1384               577    58.31%         178                35    80.34%        3243               996    69.29%         988               469    52.53%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
19258      9240             52.02%    219149  93977        57.12%

full coverage report (for internal network access only)

@xzhangxian1008
Copy link
Contributor

lgtm

@ywqzzy ywqzzy force-pushed the qualified_table_column_in_test branch from ebe80cd to 8504906 Compare August 16, 2022 08:35
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 16, 2022
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Aug 16, 2022

/merge

@ti-chi-bot
Copy link
Member

@ywqzzy: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: f9f4141

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 16, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Aug 16, 2022

Coverage for changed files

Filename                                     Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/astToExecutor.cpp                          575               134    76.70%          55                 3    94.55%        1549               359    76.82%         574               178    68.99%
Debug/astToExecutor.h                             30                 8    73.33%          22                 4    81.82%          48                12    75.00%           8                 5    37.50%
Debug/dbgFuncCoprocessor.cpp                     430               320    25.58%          39                27    30.77%         882               601    31.86%         292               220    24.66%
Flash/tests/gtest_compute_server.cpp              39                14    64.10%           3                 0   100.00%          70                 0   100.00%          12                 8    33.33%
Flash/tests/gtest_filter_executor.cpp             32                14    56.25%           3                 0   100.00%          47                 0   100.00%          10                 8    20.00%
Flash/tests/gtest_split_tasks.cpp                 43                14    67.44%           3                 0   100.00%         101                 0   100.00%          16                 8    50.00%
TestUtils/mockExecutor.cpp                        74                 3    95.95%          42                 1    97.62%         267                24    91.01%          36                 2    94.44%
TestUtils/tests/gtest_mock_executors.cpp         161                70    56.52%          11                 0   100.00%         278                 0   100.00%          40                40     0.00%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                           1384               577    58.31%         178                35    80.34%        3242               996    69.28%         988               469    52.53%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18373      8360             54.50%    211547  86358        59.18%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 49d8050 into pingcap:master Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to use qualified format to reference table column in executor test framework
7 participants