Skip to content

[Bug] (good first issue) Add trim to table attributes during table creation #47851

Open
@deardeng

Description

@deardeng

Search before asking

  • I had searched in the issues and found no similar issues.

Version

doris master

What's Wrong?

Fix many properties in the table building attribute that do not have a trim, which may result in errors in the subsequent process

BUG!

  1. first after create table , show create table "dynamic_partition.start " = "-7"
  2. alter table tbl1 set ( "dynamic_partition.start " = "-2147483648"); return ok
  3. There is an extra space after 'dynamic_partition.start ' here, in step 1
  4. but not work in show create table, it dynamic_partition.start still old value
  5. I expect in show create table result dynamic_partition.start = -2147483648, not -7
mysql> CREATE TABLE tbl1
    -> (
    ->     k1 DATE,
    ->     k2 varchar(20)
    -> )
DISTRIBUTED BY HASH(k1)
    -> PARTITION BY RANGE(k1) ()
    -> DISTRIBUTED BY HASH(k1)
    -> PROPERTIES
    -> (
    ->   "replication_num"="1",
    ->     "dynamic_partition.enable" = "true",
    ->     "dynamic_partition.time_unit" = "DAY",
    ->     "dynamic_partition.start" = "-7",
    ->     "dynamic_partition.end" = "3",
    ->     "dynamic_partition.prefix" = "p",
    ->     "dynamic_partition.buckets" = "32"
    -> );
Query OK, 0 rows affected (0.09 sec)mysql> alter table tbl1 set ( "dynamic_partition.start " = "-2147483648");
Query OK, 0 rows affected (0.00 sec)mysql> show create table tbl1;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tbl1  | CREATE TABLE `tbl1` (
  `k1` date NULL,
  `k2` varchar(20) NULL
) ENGINE=OLAP
DUPLICATE KEY(`k1`, `k2`)
PARTITION BY RANGE(`k1`)
(PARTITION p20241206 VALUES [('2024-12-06'), ('2024-12-07')),
PARTITION p20241207 VALUES [('2024-12-07'), ('2024-12-08')),
PARTITION p20241208 VALUES [('2024-12-08'), ('2024-12-09')),
PARTITION p20241209 VALUES [('2024-12-09'), ('2024-12-10')))
DISTRIBUTED BY HASH(`k1`) BUCKETS 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-7",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 1",
"dynamic_partition.buckets" = "32",
"dynamic_partition.create_history_partition" = "false",
"dynamic_partition.history_partition_num" = "-1",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V1",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
); |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)mysql>  
Image

What You Expected?

  1. trime table properties when create table or alter table
  2. and add some regression case

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions