-
Notifications
You must be signed in to change notification settings - Fork 21
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
Restrict COPY to intermediate partition tables #979
Conversation
Copy to a mid-level partition led to insert into such partition instead of leaf partition. This patch adds check, which does not allow copy to a mid-level partition. Correct copy should be into root partition or leaf partition.
Allure report https://allure.adsw.io/launch/74001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that we are testing the insertion into the intermediate partition and into the root twice. Is there any difference between these tests?
Restrict COPY TO intermediate partition tables
It seems to me that it is necessary to say more clearly which command we are talking about. Something like:
Restrict COPY FROM on intermediate partition tables.
Failed job Build for ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1586353 |
Failed job Build for x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1586352 |
Failed job Build for ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1586404 |
Failed job Build for x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1586403 |
Failed job Build for x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1586586 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like two cases are tested twice is it necessary?
Allure report https://allure.adsw.io/launch/74316 |
Failed job Behave tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1596715 |
Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1596711 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without a patch, only the following diff appears:
COPY tmp_table TO '/tmp/table_data';
-- Copy to the mid-level partition should fail
COPY part_table_1_prt_2 FROM '/tmp/table_data';
-ERROR: cannot copy to intermediate part of a partitioned table
-HINT: consider using COPY to either the root or a leaf partition instead.
+WARNING: skipping "part_table_1_prt_2" --- cannot analyze a mid-level partition. Please run ANALYZE on the root partition table.
-- Copy to the leaf partition should use check constraint and fail
COPY part_table_1_prt_2_2_prt_part_a FROM '/tmp/table_data';
ERROR: new row for relation "part_table_1_prt_2_2_prt_part_a" violates check constraint "part_table_1_prt_2_2_prt_part_a_check"
@@ -1399,8 +1439,7 @@
COPY tmp_table TO '/tmp/table_data';
-- Copy to a mid-level partition should fail
COPY part_table_1_prt_2 FROM '/tmp/table_data';
-ERROR: cannot copy to intermediate part of a partitioned table
-HINT: consider using COPY to either the root or a leaf partition instead.
+WARNING: skipping "part_table_1_prt_2" --- cannot analyze a mid-level partition. Please run ANALYZE on the root partition table.
-- Copy to a leaf partition should use check constraint and be success
COPY part_table_1_prt_2_2_prt_part_a FROM '/tmp/table_data';
analyze part_table;
Are some the tests redundant? We are testing something that is not related to the patch.
Patch restricts copy to intermediate partitions, but test checks, that copy to the other type of partitions works correctly after this fix. To check only copy to intermediate partition is not full test. |
Allure report https://allure.adsw.io/launch/74448 |
Failed job Regression tests with Postgres on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1602749 |
Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1602752 |
Allure report https://allure.adsw.io/launch/74474 |
Allure report https://allure.adsw.io/launch/74535 |
Failed job Behave tests on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1607066 |
Failed job Regression tests with Postgres on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1607059 |
Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1607061 |
Allure report https://allure.adsw.io/launch/74669 |
Failed job Behave tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1613617 |
Failed job Behave tests on ppc64le: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1614954 |
Allure report https://allure.adsw.io/launch/75137 |
Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1635814 |
Failed job Regression tests with Postgres on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1635812 |
Failed job Regression tests with Postgres on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1637397 |
Failed job Regression tests with ORCA on x86_64: https://gitlab.adsw.io/arenadata/github_mirroring/gpdb/-/jobs/1637396 |
Restrict COPY to intermediate partition tables
Copy to a mid-level partition led to insert into such partition instead of leaf
partition. This patch adds check, which does not allow copy to a mid-level
partition. Correct copy should be into root partition or leaf partition.