内容同 Issue:https://github.com/apache/doris/issues/29778
建表语句
-- origin_events.origin_aiot_narwal_bury_robot_stats_mem_event definition
CREATE TABLE `origin_aiot_narwal_bury_robot_stats_mem_event` (
`eventId` VARCHAR(30) NULL,
`robotId` VARCHAR(100) NULL,
`time` VARCHAR(50) NULL,
`dt` DATE NULL,
`productId` VARCHAR(100) NULL,
`robotVer` VARCHAR(100) NULL,
`env` VARCHAR(10) NULL,
`rTime` VARCHAR(50) NULL,
`kafkaTime` VARCHAR(50) NULL,
`groupName` VARCHAR(100) NULL,
`message` TEXT NULL
) ENGINE=OLAP
UNIQUE KEY(`eventId`, `robotId`, `time`, `dt`)
COMMENT '-mem'
PARTITION BY RANGE(`dt`)
(PARTITION p20240821 VALUES [('2024-08-21'), ('2024-08-22')),
PARTITION p20240822 VALUES [('2024-08-22'), ('2024-08-23')),
PARTITION p20240823 VALUES [('2024-08-23'), ('2024-08-24')),
PARTITION p20240824 VALUES [('2024-08-24'), ('2024-08-25')),
PARTITION p20240825 VALUES [('2024-08-25'), ('2024-08-26')),
PARTITION p20240826 VALUES [('2024-08-26'), ('2024-08-27')),
PARTITION p20240827 VALUES [('2024-08-27'), ('2024-08-28')),
PARTITION p20240828 VALUES [('2024-08-28'), ('2024-08-29')),
PARTITION p20240829 VALUES [('2024-08-29'), ('2024-08-30')),
PARTITION p20240830 VALUES [('2024-08-30'), ('2024-08-31')),
PARTITION p20240831 VALUES [('2024-08-31'), ('2024-09-01')))
DISTRIBUTED BY HASH(`robotId`) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 2",
"min_load_replica_num" = "2",
"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: 3",
"dynamic_partition.buckets" = "32",
"dynamic_partition.create_history_partition" = "true",
"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",
"enable_unique_key_merge_on_write" = "true",
"light_schema_change" = "true",
"compaction_policy" = "time_series",
"time_series_compaction_goal_size_mbytes" = "1024",
"time_series_compaction_file_count_threshold" = "2000",
"time_series_compaction_time_threshold_seconds" = "3600",
"time_series_compaction_empty_rowsets_threshold" = "5",
"time_series_compaction_level_threshold" = "1",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "true",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
);
查询语句:
SELECT count(*)
FROM origin_aiot_narwal_bury_robot_stats_mem_event
where dt='2024-08-26';
查询结果每次都不一致