【StarRocks版本】3.1.12
【集群规模】3fe+3be(fe与be混部)
相同SQL,同一台FE,不同客户端地址发起查询,一台有数据,一个无数据,是什么原因?
查询有结果
查询无结果
这俩SQL看起来不一样啊
一样的,图一没有截全
有数据:
mysql> select count(1) from (
-> select *
-> from example_db.ads_guanxing_org_pro_sptm_sal_ttl t
-> where 1 = 1
-> and is_noimport_store = 1
-> and last_update_date >= '2024-03-23'
-> and last_update_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.min_counter_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1,
-> 10)
-> and is_first_spider_abnormal_date not between '2024-03-23' and substr(
-> cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.category2_no in ('50006843')
-> and t.view_amt >= '100.0'
-> and t.view_amt <= '500.0'
-> and arrays_overlap(split(style_name_list, '|'), split('小白鞋', ','))
-> order by view_amt desc) as a;
+----------+
| count(1) |
+----------+
| 4 |
+----------+
1 row in set (0.02 sec)
mysql>
无数据:
MySQL [example_db]> select count(1) from (
-> select *
-> from example_db.ads_guanxing_org_pro_sptm_sal_ttl t
-> where 1 = 1
-> and is_noimport_store = 1
-> and last_update_date >= '2024-03-23'
-> and last_update_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.min_counter_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1,
-> 10)
-> and is_first_spider_abnormal_date not between '2024-03-23' and substr(
-> cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.category2_no in ('50006843')
-> and t.view_amt >= '100.0'
-> and t.view_amt <= '500.0'
-> and arrays_overlap(split(style_name_list, '|'), split('', ','))
-> order by view_amt desc) as a;
+----------+
| count(1) |
+----------+
| 0 |
+----------+
1 row in set (0.03 sec)
arrays_overlap(split(style_name_list, ‘|’), split(‘小白鞋’, ‘,’))
vs
arrays_overlap(split(style_name_list, ‘|’), split(’’, ‘,’))
饿,我知道了,SQL是我复制粘贴过去的,这句直接里面有中文,直接给我省略了
大佬,这两个SQL不能兼容吗?从2.5.8升级到3.1.12执行结果不一样
只有where条件的差异。
sql1:
mysql> select count(1) from (
-> select
-> *
-> from
-> example_db.ads_guanxing_org_pro_sptm_sal_ttl t
-> where
-> 1 = 1
-> and is_noimport_store = 1
-> and last_update_date >= '2024-03-23'
-> and last_update_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.min_counter_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1,10)
-> and is_first_spider_abnormal_date not between '2024-03-23' and substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.category2_no in ('50006843')
-> and t.view_amt >= cast('100.0' as double)
-> and t.view_amt <= cast('500.0' as double)
-> and arrays_overlap(split(style_name_list,'|'),
-> split('小白鞋',','))
-> order by
-> view_amt desc) as a ;
+----------+
| count(1) |
+----------+
| 10 |
+----------+
1 row in set (0.03 sec)
sql2:
mysql> select count(1) from (
-> select
-> *
-> from
-> example_db.ads_guanxing_org_pro_sptm_sal_ttl t
-> where
-> 1 = 1
-> and is_noimport_store = 1
-> and last_update_date >= '2024-03-23'
-> and last_update_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.min_counter_date <= substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1,10)
-> and is_first_spider_abnormal_date not between '2024-03-23' and substr(cast(date_sub(from_unixtime(unix_timestamp()), 1) as string), 1, 10)
-> and t.category2_no in ('50006843')
-> and t.view_amt >= '100.0'
-> and t.view_amt <= '500.0'
-> and arrays_overlap(split(style_name_list,'|'),
-> split('小白鞋',','))
-> order by
-> view_amt desc) as a ;
+----------+
| count(1) |
+----------+
| 4 |
+----------+
1 row in set (0.02 sec)
弄个profile看看