Comments (5)
@huansong @Chibin work together and see what follow-up is required for this one. New syntax usage is preferred for sure compared to old exchange as its better.
Though we should still know why old syntax didn't work - as expected to work (guessing something funky going on with partition name - didn't check the details).
from gpdb.
The below set of commands (using the new syntax) does work so maybe you can just change the documentation to reflect the new syntax and indicate the old syntax no longer is supported in this case:
externalize_part_step1:
create writable external table rp_tests.ext_rp_date_ext20150602 (like "rp_tests"."rp_date_ext") location ('gpfdist://localhost:8099/rp_tests_ext_rp_date_ext201506021714268232_3423479_0.gz') format 'text' (delimiter '|' null '')
externalize_part_step2:
insert into rp_tests.ext_rp_date_ext20150602 select * from rp_tests.rp_date_ext_1_prt_2
Rows Inserted: 100
externalize_part_step3:
create external table rp_tests.r_ext_rp_date_ext20150602 (like "rp_tests"."rp_date_ext") location ('gpfdist://localhost:8099/rp_tests_ext_rp_date_ext201506021714268232_3423479_0.gz') format 'text' (delimiter '|' null '')
externalize_part_step4:
alter table "rp_tests"."rp_date_ext" detach partition rp_tests.rp_date_ext_1_prt_2
externalize_part_step5:
alter table "rp_tests"."rp_date_ext" attach partition rp_tests.r_ext_rp_date_ext20150602 for values from ('2015-06-02') to ('2015-06-03')
externalize_part_step6.1:
drop table rp_tests.rp_date_ext_1_prt_2
externalize_part_step6.2:
drop external table rp_tests.ext_rp_date_ext20150602
Here is the link to the incorrect documentation in 7.1:
"Exchanging a Leaf Partition with an External Table"
from gpdb.
Just throwing this out here, I saw found this test that's similar?:
-- This used to work on GPDB 6 and below, but it is now rejected. ALTER
-- PARTITION is used to address subpartitions, it is not needed otherwise.
create table parttab_y (a int4, b int4) distributed by (a);
alter table parttab alter partition for (1) exchange partition for (1) with table parttab_y;
ERROR: table "parttab_1_prt_1" is not partitioned
from gpdb.
Thanks for the report.
Yes ALTER PARTITION
is supposed to be used in a multi-level partition hierarchy. As mentioned in doc:
If altering a partition deeper than the first level of partitions, use ALTER PARTITION clauses to specify which sub-partition in the hierarchy you want to alter
It actualy has the same meaning in 6X doc: https://docs.vmware.com/en/VMware-Greenplum/6/greenplum-database/ref_guide-sql_commands-ALTER_TABLE.html. But the query like you specified just somehow worked in 6X. So you are not the first one encountering this issue :) : #15055 (comment).
So if we take out ALTER PARTITION
it would work:
alter table "rp_tests"."rp_date_ext"
exchange partition for ('2015-06-01')
with table rp_tests.r_ext_rp_date_ext20150601
without validation;
from gpdb.
from gpdb.
Related Issues (20)
- Find bug "ERROR: token for user id: 10, session: 11 doesn't exist (cdbendpoint.c:942)" when I use PARALLEL RETRIEVE CURSOR HOT 1
- gppkg in version 7 issues HOT 4
- Madlib packaging issue in Greenplum 7 for madlib 2.1.0 rhel8 HOT 2
- REGRESSION: Queries that works in releases prior to 7, fails in 7 HOT 6
- EXCEPT over no columns reports ERROR: unexpected gang size HOT 1
- Maybe we should not cancel unfinished parallel retrieve cursor when retrieve connection exiting? HOT 3
- GPDB7 gp_toolkit.gp_partitions partition_level differs from GPDB6 pg_partitions partition_level HOT 2
- GPDB7 REGRESSION: Removal of appendonly from reloptions, how to tell now that a parent table of a partitioned table was created with appendonly? HOT 7
- GPDB7 REGRESSION: pg_partition_columns "comparable view" in documentation is not comparable HOT 5
- ERROR: variable not found in subplan target list (setrefs.c:2555) HOT 1
- How to read the storage files of an AO table and recover the data as much as possible. HOT 4
- Memory pool is necessary! HOT 3
- The global deadlock detected process of the greenplum master node has abnormal RSS memory usage. HOT 29
- Incorrect version in configure.in file. HOT 2
- could not access status of transaction 70523908 (slru.c:896) HOT 1
- How Greenplum views the amount of data exchanged between cross data nodes in motion in a distributed execution plan? HOT 2
- ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list HOT 1
- REINDEX the primary key result in a key conflict issue HOT 2
- query crash when contain multiple shareinput in qd slice HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpdb.