You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create repository mysnapdata type fs with (location='/cratesnapshots');
CREATETABLEmyschema.table1 (part_key int,anotherfield text) PARTITIONED BY (part_key);
INSERT INTOmyschema.table1 (part_key,anotherfield) VALUES
(1,'first value on partition 1')
,(2,'first value on partition 2');
refresh table myschema.table1;
create snapshot mysnapdata.snapshot1 all with (wait_for_completion=true);
updatemyschema.table1set anotherfield='new value';
refresh table myschema.table1;
select*frommyschema.table1;
/*+----------+--------------+| part_key | anotherfield |+----------+--------------+| 1 | new value || 2 | new value |+----------+--------------+*/
RESTORE SNAPSHOT mysnapdata.snapshot1 TABLE myschema.table1 partition (part_key =2) with (schema_rename_replacement ='newschema', table_rename_replacement ='mytable', wait_for_completion=true);
Actual Result
SELECT table_name, table_schema FROMinformation_schema.tableswhere table_schema in ('myschema','newschema');
/*+------------+--------------+| table_name | table_schema |+------------+--------------+| mytable | newschema || table1 | myschema |+------------+--------------+*/select*frommyschema.table1;
/*+----------+----------------------------+| part_key | anotherfield |+----------+----------------------------+| 1 | new value || 2 | new value || 2 | first value on partition 2 |+----------+----------------------------+--> the restore happened against the original table*/select*fromnewschema.mytable;
/*+----------+--------------+| part_key | anotherfield |+----------+--------------++----------+--------------+--> but the new table got created empty*/
Expected Result
The restore happens against newschema.mytable and myschema.table1 is left untouched.
The text was updated successfully, but these errors were encountered:
CrateDB version
5.7.1
CrateDB setup information
See repro steps
Problem description
According to https://community.cratedb.com/t/restore-snapshot-into-new-table-name/167/4 it should be possible to restore a table from a snapshot using a different name however there seems to be an issue with partitioned tables, see below.
Steps to Reproduce
Actual Result
Expected Result
The restore happens against
newschema.mytable
andmyschema.table1
is left untouched.The text was updated successfully, but these errors were encountered: