Skip to content

doris like查询数据不正确 #30425

@hnwkz

Description

@hnwkz

Search before asking

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

Version

doris 2.0.3-rc6

What's Wrong?

select * from ad_raw_data.cfg_costs_advanced_hour_agency where campaign LIKE '%facebook_10008_T1+%' and start_at >= '2024-01-01'; 能查出结果
select * from ad_raw_data.cfg_costs_advanced_hour_agency where campaign LIKE '%facebook_10008_T1+T2%' and start_at >= '2024-01-01'; 查不出结果
select * from ad_raw_data.cfg_costs_advanced_hour_agency
where campaign = 'facebook_10008_T1+T2-ALL_AAA-VO_LowestCost_20230830_HSJ'
and start_at >= '2024-01-01'; 查出结果

image

b28b96439634c6b0c453f89d8d0c7a7

image

表结构:
CREATE TABLE cfg_costs_advanced_hour_agency (
start_at datetime NULL,
end_at datetime NULL,
game_id int(11) NULL,
app_id varchar(90) NULL,
os_name varchar(24) NULL,
af_prt varchar(144) NULL,
media varchar(72) NULL,
af_siteid varchar(219) NULL,
af_sub_siteid varchar(150) NULL,
country varchar(21) NULL,
campaign_id varchar(351) NULL,
adgroup_id varchar(588) NULL,
creative_id varchar(765) NULL,
campaign text NULL,
adgroup text NULL,
creative text NULL,
amount double NULL,
is_shared int(11) NULL,
created_at datetime(3) NULL,
deleted_at datetime(3) NULL,
is_deleted int(11) NULL,
id text NULL,
source text NULL,
amount_rmb double NULL,
gift_amount double NULL,
impressions bigint(20) NULL,
clicks bigint(20) NULL,
gift_amount_rmb double NULL,
before_rebate_amount double NULL,
before_rebate_amount_rmb double NULL,
shenji double NULL,
impressions_shenji double NULL,
clicks_shenji double NULL,
link_clicks bigint(20) NULL
) ENGINE=OLAP
UNIQUE KEY(start_at, end_at, game_id, app_id, os_name, af_prt, media, af_siteid, af_sub_siteid, country, campaign_id, adgroup_id, creative_id)
COMMENT 'OLAP'
PARTITION BY RANGE(start_at)
(PARTITION p201711 VALUES [('2017-11-01 00:00:00'), ('2017-12-01 00:00:00')),
PARTITION p201712 VALUES [('2017-12-01 00:00:00'), ('2018-01-01 00:00:00')),
PARTITION p201801 VALUES [('2018-01-01 00:00:00'), ('2018-02-01 00:00:00')),
PARTITION p201802 VALUES [('2018-02-01 00:00:00'), ('2018-03-01 00:00:00')),
PARTITION p201803 VALUES [('2018-03-01 00:00:00'), ('2018-04-01 00:00:00')),
PARTITION p201804 VALUES [('2018-04-01 00:00:00'), ('2018-05-01 00:00:00')),
PARTITION p201805 VALUES [('2018-05-01 00:00:00'), ('2018-06-01 00:00:00')),
PARTITION p201806 VALUES [('2018-06-01 00:00:00'), ('2018-07-01 00:00:00')),
PARTITION p201807 VALUES [('2018-07-01 00:00:00'), ('2018-08-01 00:00:00')),
PARTITION p201808 VALUES [('2018-08-01 00:00:00'), ('2018-09-01 00:00:00')),
PARTITION p201809 VALUES [('2018-09-01 00:00:00'), ('2018-10-01 00:00:00')),
PARTITION p201810 VALUES [('2018-10-01 00:00:00'), ('2018-11-01 00:00:00')),
PARTITION p201811 VALUES [('2018-11-01 00:00:00'), ('2018-12-01 00:00:00')),
PARTITION p201812 VALUES [('2018-12-01 00:00:00'), ('2019-01-01 00:00:00')),
PARTITION p201901 VALUES [('2019-01-01 00:00:00'), ('2019-02-01 00:00:00')),
PARTITION p201902 VALUES [('2019-02-01 00:00:00'), ('2019-03-01 00:00:00')),
PARTITION p201903 VALUES [('2019-03-01 00:00:00'), ('2019-04-01 00:00:00')),
PARTITION p201904 VALUES [('2019-04-01 00:00:00'), ('2019-05-01 00:00:00')),
PARTITION p201905 VALUES [('2019-05-01 00:00:00'), ('2019-06-01 00:00:00')),
PARTITION p201906 VALUES [('2019-06-01 00:00:00'), ('2019-07-01 00:00:00')),
PARTITION p201907 VALUES [('2019-07-01 00:00:00'), ('2019-08-01 00:00:00')),
PARTITION p201908 VALUES [('2019-08-01 00:00:00'), ('2019-09-01 00:00:00')),
PARTITION p201909 VALUES [('2019-09-01 00:00:00'), ('2019-10-01 00:00:00')),
PARTITION p201910 VALUES [('2019-10-01 00:00:00'), ('2019-11-01 00:00:00')),
PARTITION p201911 VALUES [('2019-11-01 00:00:00'), ('2019-12-01 00:00:00')),
PARTITION p201912 VALUES [('2019-12-01 00:00:00'), ('2020-01-01 00:00:00')),
PARTITION p202001 VALUES [('2020-01-01 00:00:00'), ('2020-02-01 00:00:00')),
PARTITION p202002 VALUES [('2020-02-01 00:00:00'), ('2020-03-01 00:00:00')),
PARTITION p202003 VALUES [('2020-03-01 00:00:00'), ('2020-04-01 00:00:00')),
PARTITION p202004 VALUES [('2020-04-01 00:00:00'), ('2020-05-01 00:00:00')),
PARTITION p202005 VALUES [('2020-05-01 00:00:00'), ('2020-06-01 00:00:00')),
PARTITION p202006 VALUES [('2020-06-01 00:00:00'), ('2020-07-01 00:00:00')),
PARTITION p202007 VALUES [('2020-07-01 00:00:00'), ('2020-08-01 00:00:00')),
PARTITION p202008 VALUES [('2020-08-01 00:00:00'), ('2020-09-01 00:00:00')),
PARTITION p202009 VALUES [('2020-09-01 00:00:00'), ('2020-10-01 00:00:00')),
PARTITION p202010 VALUES [('2020-10-01 00:00:00'), ('2020-11-01 00:00:00')),
PARTITION p202011 VALUES [('2020-11-01 00:00:00'), ('2020-12-01 00:00:00')),
PARTITION p202012 VALUES [('2020-12-01 00:00:00'), ('2021-01-01 00:00:00')),
PARTITION p202101 VALUES [('2021-01-01 00:00:00'), ('2021-02-01 00:00:00')),
PARTITION p202102 VALUES [('2021-02-01 00:00:00'), ('2021-03-01 00:00:00')),
PARTITION p202103 VALUES [('2021-03-01 00:00:00'), ('2021-04-01 00:00:00')),
PARTITION p202104 VALUES [('2021-04-01 00:00:00'), ('2021-05-01 00:00:00')),
PARTITION p202105 VALUES [('2021-05-01 00:00:00'), ('2021-06-01 00:00:00')),
PARTITION p202106 VALUES [('2021-06-01 00:00:00'), ('2021-07-01 00:00:00')),
PARTITION p202107 VALUES [('2021-07-01 00:00:00'), ('2021-08-01 00:00:00')),
PARTITION p202108 VALUES [('2021-08-01 00:00:00'), ('2021-09-01 00:00:00')),
PARTITION p202109 VALUES [('2021-09-01 00:00:00'), ('2021-10-01 00:00:00')),
PARTITION p202110 VALUES [('2021-10-01 00:00:00'), ('2021-11-01 00:00:00')),
PARTITION p202111 VALUES [('2021-11-01 00:00:00'), ('2021-12-01 00:00:00')),
PARTITION p202112 VALUES [('2021-12-01 00:00:00'), ('2022-01-01 00:00:00')),
PARTITION p202201 VALUES [('2022-01-01 00:00:00'), ('2022-02-01 00:00:00')),
PARTITION p202202 VALUES [('2022-02-01 00:00:00'), ('2022-03-01 00:00:00')),
PARTITION p202203 VALUES [('2022-03-01 00:00:00'), ('2022-04-01 00:00:00')),
PARTITION p202204 VALUES [('2022-04-01 00:00:00'), ('2022-05-01 00:00:00')),
PARTITION p202205 VALUES [('2022-05-01 00:00:00'), ('2022-06-01 00:00:00')),
PARTITION p202206 VALUES [('2022-06-01 00:00:00'), ('2022-07-01 00:00:00')),
PARTITION p202207 VALUES [('2022-07-01 00:00:00'), ('2022-08-01 00:00:00')),
PARTITION p202208 VALUES [('2022-08-01 00:00:00'), ('2022-09-01 00:00:00')),
PARTITION p202209 VALUES [('2022-09-01 00:00:00'), ('2022-10-01 00:00:00')),
PARTITION p202210 VALUES [('2022-10-01 00:00:00'), ('2022-11-01 00:00:00')),
PARTITION p202211 VALUES [('2022-11-01 00:00:00'), ('2022-12-01 00:00:00')),
PARTITION p202212 VALUES [('2022-12-01 00:00:00'), ('2023-01-01 00:00:00')),
PARTITION p202301 VALUES [('2023-01-01 00:00:00'), ('2023-02-01 00:00:00')),
PARTITION p202302 VALUES [('2023-02-01 00:00:00'), ('2023-03-01 00:00:00')),
PARTITION p202303 VALUES [('2023-03-01 00:00:00'), ('2023-04-01 00:00:00')),
PARTITION p202304 VALUES [('2023-04-01 00:00:00'), ('2023-05-01 00:00:00')),
PARTITION p202305 VALUES [('2023-05-01 00:00:00'), ('2023-06-01 00:00:00')),
PARTITION p202306 VALUES [('2023-06-01 00:00:00'), ('2023-07-01 00:00:00')),
PARTITION p202307 VALUES [('2023-07-01 00:00:00'), ('2023-08-01 00:00:00')),
PARTITION p202308 VALUES [('2023-08-01 00:00:00'), ('2023-09-01 00:00:00')),
PARTITION p202309 VALUES [('2023-09-01 00:00:00'), ('2023-10-01 00:00:00')),
PARTITION p202310 VALUES [('2023-10-01 00:00:00'), ('2023-11-01 00:00:00')),
PARTITION p202311 VALUES [('2023-11-01 00:00:00'), ('2023-12-01 00:00:00')),
PARTITION p202312 VALUES [('2023-12-01 00:00:00'), ('2024-01-01 00:00:00')),
PARTITION p202401 VALUES [('2024-01-01 00:00:00'), ('2024-02-01 00:00:00')),
PARTITION p202402 VALUES [('2024-02-01 00:00:00'), ('2024-03-01 00:00:00')),
PARTITION p202403 VALUES [('2024-03-01 00:00:00'), ('2024-04-01 00:00:00')),
PARTITION p202404 VALUES [('2024-04-01 00:00:00'), ('2024-05-01 00:00:00')))
DISTRIBUTED BY HASH(start_at) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "MONTH",
"dynamic_partition.time_zone" = "Europe/London",
"dynamic_partition.start" = "-2147483648",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "1",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "73",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"dynamic_partition.storage_medium" = "HDD",
"dynamic_partition.start_day_of_month" = "1",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);

样例数据:
INSERT INTO ad_raw_data.cfg_costs_advanced_hour_agency (start_at, end_at, game_id, app_id, os_name, af_prt, media, af_siteid, af_sub_siteid, country, campaign_id, adgroup_id, creative_id, campaign, adgroup, creative, amount, is_shared, created_at, deleted_at, is_deleted, id, source, amount_rmb, gift_amount, impressions, clicks, gift_amount_rmb, before_rebate_amount, before_rebate_amount_rmb, shenji, impressions_shenji, clicks_shenji, link_clicks) VALUES ('2024-01-01 00:00:00', '2024-01-01 00:00:00', 10008, 'xxxxxxxxxxxx', 'android', 'Madhouse', 'facebook', '', '', 'ad', '23857074395469350638', '238570743456959970638', '23857076135466540638', 'facebook_10008_T1+T2-ALL_AAA-VO_LowestCost_20230830_HSJ', 'CA_alluser_AAA-VO-LowestCost_M_18+_T1+T2', 'facebook_10008_en_b001', 0.009998, 1, '2024-01-26 07:50:00', null, 0, '58721fec5045fa25ce3cdc28b967de878a', 'facebook', null, null, 9, 0, null, null, null, null, null, null, 0);

INSERT INTO ad_raw_data.cfg_costs_advanced_hour_agency (start_at, end_at, game_id, app_id, os_name, af_prt, media, af_siteid, af_sub_siteid, country, campaign_id, adgroup_id, creative_id, campaign, adgroup, creative, amount, is_shared, created_at, deleted_at, is_deleted, id, source, amount_rmb, gift_amount, impressions, clicks, gift_amount_rmb, before_rebate_amount, before_rebate_amount_rmb, shenji, impressions_shenji, clicks_shenji, link_clicks) VALUES ('2024-01-01 00:00:00', '2024-01-01 00:00:00', 10008, 'xxxxxxxxxxxxxxx', 'android', 'Madhouse', 'facebook', '', '', 'ad', '2385707dfd4399350638', '23857074dfd399970638', '238570761435339170638', 'facebook_10008_T1+T2-ALL_AAA-VO_LowestCost_20230830_HSJ', 'CA_alluser_AAA-VO-LowestCost_M_18+_T1+T2', 'facebook_10008_en_B230529004', 0, 1, '2024-01-26 07:50:00', null, 0, '58721fec45450fa25ce3cdc28b967de878a', 'facebook', null, null, 2, 0, null, null, null, null, null, null, 0);

INSERT INTO ad_raw_data.cfg_costs_advanced_hour_agency (start_at, end_at, game_id, app_id, os_name, af_prt, media, af_siteid, af_sub_siteid, country, campaign_id, adgroup_id, creative_id, campaign, adgroup, creative, amount, is_shared, created_at, deleted_at, is_deleted, id, source, amount_rmb, gift_amount, impressions, clicks, gift_amount_rmb, before_rebate_amount, before_rebate_amount_rmb, shenji, impressions_shenji, clicks_shenji, link_clicks) VALUES ('2024-01-01 00:00:00', '2024-01-01 00:00:00', 10008, 'xxxxxxxxxxxxx', 'android', 'Madhouse', 'facebook', '', '', 'ad', '238570743434399350638', '238570343474399970638', '2385707613434351740638', 'facebook_10008_T1+T2-ALL_AAA-VO_LowestCost_20230830_HSJ', 'CA_alluser_AAA-VO-LowestCost_M_18+_T1+T2', 'facebook_10008_en_素材2', 0, 1, '2024-01-26 07:50:00', null, 0, '58721fec503434fa25ce3cdc28b967de878a', 'facebook', null, null, 1, 0, null, null, null, null, null, null, 0);

What You Expected?

能正确得出结果

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions