Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: shuming.li <[email protected]>
  • Loading branch information
LiShuMing committed Dec 11, 2024
1 parent 4ba84d5 commit be63ebb
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,43 @@ select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uu
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE province like '%a%';
-- result:
[REGEX].*Column is not a partition column which can not be used in where clause for drop partition.*
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
4
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE str2date(dt, '%Y-%m-%d') = '2020-07-01';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
4
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE dt >= '2020-07-03';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
2
4
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE dt is null;
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
2
4
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE dt >= '2020-07-01';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
0
4
-- !result
drop table t1;
-- result:
Expand Down Expand Up @@ -94,38 +98,43 @@ select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uu
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE k1 >= '2020-01-01' and k1 <= '2020-01-02';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
6
7
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE date_trunc('month', k1) = '2020-02-01';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
6
7
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE k1 >= '2020-01-05';
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
4
7
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE k1 is null;
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
4
7
-- !result
ALTER TABLE t1 DROP PARTITIONS WHERE k1 <= current_date();
-- result:
E: (1064, "Getting syntax error at line 1, column 31. Detail message: No viable statement for input 'DROP PARTITIONS WHERE'.")
-- !result
select COUNT(1) from INFORMATION_SCHEMA.PARTITIONS_META where db_name = 'db_${uuid0}' and table_name like '%t1%' and partition_name != '$shadow_automatic_partition';
-- result:
0
7
-- !result
drop table t1;
-- result:
Expand Down

0 comments on commit be63ebb

Please sign in to comment.