单标分区,支持HASH/LIST/RANGE三种,每种分区只能参考一个字段

分区包含,全量数据拆分规则,增量拆分规则,以及全量,增量统一拆分规则

哈希分区(hash)

{
    "partition_type":"hash",
    "column_name":"col1",
    "hash_count":5,
    "hash_method":"auto", ##包含auto/manual两种模式
    "partition":[
        {
            "partition_no":0,
            "value":4
        },
        {
            "partition_no":1,
            "value":0
        },
        {
            "partition_no":2,
            "value":1
        },
        {
            "partition_no":3,
            "value":2
        },
        {
            "partition_no":4,
            "value":3
        }
    ]
}

列表分区(list)

  • 支持数字,字符串两种类型
    {
     "partition_type":"list",
     "column_name":"col1",
     "column_type":"number",
     "partition":[
         {
             "partition_no":1,
             "value":[1,2,3]
         },
         {
             "partition_no":2,
             "value":[4,5,6]
         },
         {
             "partition_no":3,
             "value":[7,8,9]
         },
         {
             "partition_no":4,
             "value":[-1]
         }
     ]
    }

    范围分区(包含数字,字符串,时间)三中类型

    数字类型(long)

    {
     "partition_type":"range",
     "column_name":"col1",
     "column_type":"number",
     "partition":[
         {
             "partition_no":1,
             "max_value":123,
             "min_value":0
         },
         {
             "partition_no":2,
             "max_value":250,
             "min_value":124
         },
         {
             "partition_no":3,
             "max_value":500,
             "min_value":251
         },
         {
             "partition_no":0,
             "max_value":-1,
             "min_value":-1
         }
     ]
    }

    时间类型

    {
     "partition_type":"range",
     "column_name":"col1",
     "column_type":"datetime",
     "partition":[
         {
             "partition_no":1,
             "min_value":"2023-04-01 00:00:00",
             "max_value":"2023-04-30 23:59:59"
         },
         {
             "partition_no":2,
             "min_value":"2023-05-01 00:00:00",
             "max_value":"2023-05-31 23:59:59"
         },
         {
             "partition_no":3,
             "min_value":"2023-06-01 00:00:00",
             "max_value":"2023-06-30 23:59:59"
         },
         {
             "partition_no":0,
             "min_value":"1970-01-01 00:00:00",
             "max_value":"1970-01-01 00:00:00"
         }
     ]
    }

    字符串类型

    {
     "partition_type":"range",
     "column_name":"col1",
     "column_type":"string",
     "partition":[
         {
             "partition_no":1,
             "min_value":"a",
             "max_value":"b"
         },
         {
             "partition_no":2,
             "min_value":"c",
             "max_value":"d"
         },
         {
             "partition_no":3,
             "min_value":"e",
             "max_value":"f"
         },
         {
             "partition_no":0,
             "min_value":"g",
             "max_value":"g"
         }
     ]
    }
文档更新时间: 2023-06-30 22:31   作者:阿力