--
-- insert with DEFAULT in the target_list
--
create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
^
insert into inserttest (col2, col3) values (3, DEFAULT);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (col2, col3) values (3, DEFAULT);
^
insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
^
insert into inserttest values (DEFAULT, 5, 'test');
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest values (DEFAULT, 5, 'test');
^
insert into inserttest values (DEFAULT, 7);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest values (DEFAULT, 7);
^
select * from inserttest;
--
-- insert with similar expression / target_list values (all fail)
--
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
--
^
insert into inserttest (col1, col2, col3) values (1, 2);
insert into inserttest (col1) values (1, 2);
-stdin-:: Error: Type annotation
-stdin-::1:1: Error: At function: YtWriteTable!
insert into inserttest (col1) values (1, 2);
^
-stdin-::1:1: Error: values have 2 columns, INSERT INTO expects: 1
insert into inserttest (col1) values (1, 2);
^
insert into inserttest (col1) values (DEFAULT, DEFAULT);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (col1) values (DEFAULT, DEFAULT);
^
select * from inserttest;
--
-- VALUES test
--
insert into inserttest values(10, 20, '40'), (-1, 2, DEFAULT),
((select 2), (select i from (values(3)) as foo (i)), 'values are fun!');
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
--
^
select * from inserttest;
--
-- TOASTed value test
--
insert into inserttest values(30, 50, repeat('x', 10000));
select col1, col2, char_length(col3) from inserttest;
drop table inserttest;
--
-- tuple larger than fillfactor
--
CREATE TABLE large_tuple_test (a int, b text) WITH (fillfactor = 10);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table options not supported
--
^
ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 245
ALTER TABLE large_tuple_test ALTER COLUMN b SET STORAGE plain;
^
-- create page w/ free space in range [nearlyEmptyFreeSpace, MaxHeapTupleSize)
INSERT INTO large_tuple_test (select 1, NULL);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.large_tuple_test
-- should still fit on the page
INSERT INTO large_tuple_test (select 2, repeat('a', 1000));
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.large_tuple_test
SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
-stdin-:: Fatal: Execution
-stdin-::1:1: Fatal: Execution of node: Result
SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
^
-stdin-::1:1: Fatal: ERROR: relation "large_tuple_test" does not exist
SELECT pg_size_pretty(pg_relation_size('large_tuple_test'::regclass, 'main'));
^
-- add small record to the second page
INSERT INTO large_tuple_test (select 3, NULL);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.large_tuple_test
-- now this tuple won't fit on the second page, but the insert should
-- still succeed by extending the relation
INSERT INTO large_tuple_test (select 4, repeat('a', 8126));
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.large_tuple_test
DROP TABLE large_tuple_test;
--
-- check indirection (field/array assignment), cf bug #14265
--
-- these tests are aware that transformInsertStmt has 3 separate code paths
--
create type insert_test_type as (if1 int, if2 text[]);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 314
--
^
create table inserttest (f1 int, f2 int[],
f3 insert_test_type, f4 insert_test_type[]);
insert into inserttest (f2[1], f2[2]) values (1,2);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f2[1], f2[2]) values (3,4), (5,6);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f2[1], f2[2]) select 7,8;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (f2[1], f2[2]) values (1,default); -- not supported
^
insert into inserttest (f3.if1, f3.if2) values (1,array['foo']);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f3.if1, f3.if2) values (1,'{foo}'), (2,'{bar}');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f3.if1, f3.if2) select 3, '{baz,quux}';
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: alternative is not implemented yet : 148
insert into inserttest (f3.if1, f3.if2) values (1,default); -- not supported
^
insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f3.if2[1], f3.if2[2]) values ('foo', 'bar'), ('baz', 'quux');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f3.if2[1], f3.if2[2]) select 'bear', 'beer';
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar'), ('baz', 'quux');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
insert into inserttest (f4[1].if2[1], f4[1].if2[2]) select 'bear', 'beer';
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
select * from inserttest;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.inserttest
-- also check reverse-listing
create table inserttest2 (f1 bigint, f2 text);
create rule irule1 as on insert to inserttest2 do also
insert into inserttest (f3.if2[1], f3.if2[2])
values (new.f1,new.f2);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 265
create rule irule1 as on insert to inserttest2 do also
^
create rule irule2 as on insert to inserttest2 do also
insert into inserttest (f4[1].if1, f4[1].if2[2])
values (1,'fool'),(new.f1,new.f2);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 265
create rule irule2 as on insert to inserttest2 do also
^
create rule irule3 as on insert to inserttest2 do also
insert into inserttest (f4[1].if1, f4[1].if2[2])
select new.f1, new.f2;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 265
create rule irule3 as on insert to inserttest2 do also
^
\d+ inserttest2
Metacommand \d+ inserttest2 is not supported
drop table inserttest2;
drop table inserttest;
drop type insert_test_type;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: DropStmt: alternative is not implemented yet : 373
drop type insert_test_type;
^
-- direct partition inserts should check partition bound constraint
create table range_parted (
a text,
b int
) partition by range (a, (b+0));
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: PARTITION BY clause not supported
-- direct partition inserts should check partition bound constraint
^
-- no partitions, so fail
insert into range_parted values ('a', 11);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part1 partition of range_parted for values from ('a', 1) to ('a', 10);
^
create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part2 partition of range_parted for values from ('a', 10) to ('a', 20);
^
create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part3 partition of range_parted for values from ('b', 1) to ('b', 10);
^
create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part4 partition of range_parted for values from ('b', 10) to ('b', 20);
^
-- fail
insert into part1 values ('a', 11);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part1
insert into part1 values ('b', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part1
-- ok
insert into part1 values ('a', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part1
-- fail
insert into part4 values ('b', 21);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part4
insert into part4 values ('a', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part4
-- ok
insert into part4 values ('b', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part4
-- fail (partition key a has a NOT NULL constraint)
insert into part1 values (null);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part1
-- fail (expression key (b+0) cannot be null either)
insert into part1 values (1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part1
create table list_parted (
a text,
b int
) partition by list (lower(a));
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: PARTITION BY clause not supported
create table list_parted (
^
create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_aa_bb partition of list_parted FOR VALUES IN ('aa', 'bb');
^
create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_cc_dd partition of list_parted FOR VALUES IN ('cc', 'dd');
^
create table part_null partition of list_parted FOR VALUES IN (null);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_null partition of list_parted FOR VALUES IN (null);
^
-- fail
insert into part_aa_bb values ('cc', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_aa_bb
insert into part_aa_bb values ('AAa', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_aa_bb
insert into part_aa_bb values (null);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_aa_bb
-- ok
insert into part_cc_dd values ('cC', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_cc_dd
insert into part_null values (null, 0);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_null
-- check in case of multi-level partitioned table
create table part_ee_ff partition of list_parted for values in ('ee', 'ff') partition by range (b);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
-- check in case of multi-level partitioned table
^
create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_ee_ff1 partition of part_ee_ff for values from (1) to (10);
^
create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_ee_ff2 partition of part_ee_ff for values from (10) to (20);
^
-- test default partition
create table part_default partition of list_parted default;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
-- test default partition
^
-- Negative test: a row, which would fit in other partition, does not fit
-- default partition, even when inserted directly
insert into part_default values ('aa', 2);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default
insert into part_default values (null, 2);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default
-- ok
insert into part_default values ('Zz', 2);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default
-- test if default partition works as expected for multi-level partitioned
-- table as well as when default partition itself is further partitioned
drop table part_default;
create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_xx_yy partition of list_parted for values in ('xx', 'yy') partition by list (a);
^
create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_xx_yy_p1 partition of part_xx_yy for values in ('xx');
^
create table part_xx_yy_defpart partition of part_xx_yy default;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_xx_yy_defpart partition of part_xx_yy default;
^
create table part_default partition of list_parted default partition by range(b);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_default partition of list_parted default partition by range(b);
^
create table part_default_p1 partition of part_default for values from (20) to (30);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_default_p1 partition of part_default for values from (20) to (30);
^
create table part_default_p2 partition of part_default for values from (30) to (40);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_default_p2 partition of part_default for values from (30) to (40);
^
-- fail
insert into part_ee_ff1 values ('EE', 11);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff1
insert into part_default_p2 values ('gg', 43);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default_p2
-- fail (even the parent's, ie, part_ee_ff's partition constraint applies)
insert into part_ee_ff1 values ('cc', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff1
insert into part_default values ('gg', 43);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default
-- ok
insert into part_ee_ff1 values ('ff', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff1
insert into part_ee_ff2 values ('ff', 11);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff2
insert into part_default_p1 values ('cd', 25);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default_p1
insert into part_default_p2 values ('de', 35);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_default_p2
insert into list_parted values ('ab', 21);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted values ('xx', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted values ('yy', 2);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
select tableoid::regclass, * from list_parted;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
-- Check tuple routing for partitioned tables
-- fail
insert into range_parted values ('a', 0);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- ok
insert into range_parted values ('a', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
insert into range_parted values ('a', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- fail
insert into range_parted values ('a', 20);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- ok
insert into range_parted values ('b', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
insert into range_parted values ('b', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- fail (partition key (b+0) is null)
insert into range_parted values ('a');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- Check default partition
create table part_def partition of range_parted default;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
-- Check default partition
^
-- fail
insert into part_def values ('b', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_def
-- ok
insert into part_def values ('c', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_def
insert into range_parted values (null, null);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
insert into range_parted values ('a', null);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
insert into range_parted values (null, 19);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
insert into range_parted values ('b', 20);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
select tableoid::regclass, * from range_parted;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.range_parted
-- ok
insert into list_parted values (null, 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted (a) values ('aA');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
-- fail (partition of part_ee_ff not found in both cases)
insert into list_parted values ('EE', 0);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into part_ee_ff values ('EE', 0);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff
-- ok
insert into list_parted values ('EE', 1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into part_ee_ff values ('EE', 10);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.part_ee_ff
select tableoid::regclass, * from list_parted;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
-- some more tests to exercise tuple-routing with multi-level partitioning
create table part_gg partition of list_parted for values in ('gg') partition by range (b);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
-- some more tests to exercise tuple-routing with multi-level partitioning
^
create table part_gg1 partition of part_gg for values from (minvalue) to (1);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_gg1 partition of part_gg for values from (minvalue) to (1);
^
create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_gg2 partition of part_gg for values from (1) to (10) partition by range (b);
^
create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_gg2_1 partition of part_gg2 for values from (1) to (5);
^
create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_gg2_2 partition of part_gg2 for values from (5) to (10);
^
create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_ee_ff3 partition of part_ee_ff for values from (20) to (30) partition by range (b);
^
create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_ee_ff3_1 partition of part_ee_ff3 for values from (20) to (25);
^
create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table part_ee_ff3_2 partition of part_ee_ff3 for values from (25) to (30);
^
truncate list_parted;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 257
truncate list_parted;
^
insert into list_parted values ('aa'), ('cc');
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted select 'Ff', s.a from generate_series(1, 29) s(a);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted select 'gg', s.a from generate_series(1, 9) s(a);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
insert into list_parted (b) values (1);
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
select tableoid::regclass::text, a, min(b) as min_b, max(b) as max_b from list_parted group by 1, 2 order by 1;
-stdin-:: Fatal: Table metadata loading
-stdin-:: Fatal: ydb/library/yql/providers/yt/gateway/file/yql_yt_file_services.cpp:44: Table not found: plato.list_parted
-- direct partition inserts should check hash partition bound constraint
-- Use hand-rolled hash functions and operator classes to get predictable
-- result on different machines. The hash function for int4 simply returns
-- the sum of the values passed to it and the one for text returns the length
-- of the non-empty string value passed to it or 0.
create or replace function part_hashint4_noop(value int4, seed int8)
returns int8 as $$
select value + seed;
$$ language sql immutable;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 261
-- direct partition inserts should check hash partition bound constraint
^
create operator class part_test_int4_ops
for type int4
using hash as
operator 1 =,
function 2 part_hashint4_noop(int4, int8);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 298
create operator class part_test_int4_ops
^
create or replace function part_hashtext_length(value text, seed int8)
RETURNS int8 AS $$
select length(coalesce(value, ''))::int8
$$ language sql immutable;
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 261
create or replace function part_hashtext_length(value text, seed int8)
^
create operator class part_test_text_ops
for type text
using hash as
operator 1 =,
function 2 part_hashtext_length(text, int8);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: RawStmt: alternative is not implemented yet : 298
create operator class part_test_text_ops
^
create table hash_parted (
a int
) partition by hash (a part_test_int4_ops);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: PARTITION BY clause not supported
create table hash_parted (
^
create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
-stdin-:: Error: Parse Sql
-stdin-::1:1: Error: table inheritance not supported
create table hpart0 partition of hash_parted for values with (modulus 4, remainder 0);
^