Skip to content

Commit

Permalink
fix: wrong text of show create table for partition table (#1214)
Browse files Browse the repository at this point in the history
## Rationale
The text is wrong of `show create table` for partition table.

## Detailed Changes
Add the missing `PARTITION BY RANDOM` to the output of `show create
table`.

## Test Plan
Existing tests.
  • Loading branch information
ShiKaiWi authored Sep 15, 2023
1 parent c3d17bf commit d86f639
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ affected_rows: 0
SHOW CREATE TABLE random_partition_table_t;

Table,Create Table,
String("random_partition_table_t"),String("CREATE TABLE `random_partition_table_t` (`tsid` uint64 NOT NULL, `t` timestamp NOT NULL, `name` string TAG, `id` int TAG, `value` double NOT NULL, PRIMARY KEY(tsid,t), TIMESTAMP KEY(t)) PARTITIONS 4 ENGINE=Analytic WITH(arena_block_size='2097152', compaction_strategy='default', compression='ZSTD', enable_ttl='false', memtable_type='skiplist', num_rows_per_row_group='8192', segment_duration='', storage_format='AUTO', ttl='7d', update_mode='APPEND', write_buffer_size='33554432')"),
String("random_partition_table_t"),String("CREATE TABLE `random_partition_table_t` (`tsid` uint64 NOT NULL, `t` timestamp NOT NULL, `name` string TAG, `id` int TAG, `value` double NOT NULL, PRIMARY KEY(tsid,t), TIMESTAMP KEY(t)) PARTITION BY RANDOM PARTITIONS 4 ENGINE=Analytic WITH(arena_block_size='2097152', compaction_strategy='default', compression='ZSTD', enable_ttl='false', memtable_type='skiplist', num_rows_per_row_group='8192', segment_duration='', storage_format='AUTO', ttl='7d', update_mode='APPEND', write_buffer_size='33554432')"),


INSERT INTO random_partition_table_t (t, name, value)
Expand Down
2 changes: 1 addition & 1 deletion interpreters/src/show_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl ShowCreateInterpreter {
}
}
PartitionInfo::Random(v) => {
format!(" PARTITIONS {}", v.definitions.len())
format!(" PARTITION BY RANDOM PARTITIONS {}", v.definitions.len())
}
}
}
Expand Down

0 comments on commit d86f639

Please sign in to comment.