У меня есть таблица, схема выглядит так:
struct TBL{
1:optional string category;
2:optional string endpoint;
3:optional string priority;
4:optional i64 timestap;
5:optional string traceId;
6:optional string rpcId;
7:optional string businessId;
8:optional string message;
9:optional int date;
}
Я забочусь только о 8:optional string message;
message
поле log
.
У меня есть список URL, некоторые из которых можно найти в поле message
. Мне нужно найти, какие URL можно найти в таблице. В поле message
URL всегда содержит "getRequestURL"
, например
10.128.226.31,[INFO 2019-03-13 10:00:18.770] [resin-port-9300-44] [aaaLiMKyYK9bNbetoyhLw_-301570423] com.example.cashpay.filter.StaticFilter.doFilter(StaticFilter.java:99) [getRequestURL=http://www.example.com/merchant/deduct/query/v3]
Стол очень большой.
Сначала я хочу отфильтровать таблицу, скажем:
select message from TBL where message like '%getRequestURL%' and date ='20190319'
и затем я могу использовать объединенный запрос, чтобы найти, какие URL-адреса находятся в отфильтрованной таблице выше.
говорят:
select 'com/res/doc/eula/help.html', count(1) from filtered_tbl where message like 'com/res/doc/eula/help.html'
union
select 'com/charge/bank/alipay_wap/', count(1) from filtered_tbl where message like 'com/charge/bank/'
union
select 'com/reductionActivity/queryRegisterStatus', count(1) from filtered_tbl where message like 'com/reductionActivity/queryRegisterStatus'
union
select 'com/charge/pushcmd', count(1) from filtered_tbl where message like 'com/charge/pushcmd'
union......
Улей в первую очередь поддерживает фильтр? Если это поддерживает, то что я могу сделать?