A: select report_time
,mac
,hw_type
,model
,pre_model
from source_table_filter
match_recognize(
partition by mac
order by report_time
measures
,e2.hw_type as hw_type
,concat(coalesce(e2.factory,''),' ',coalesce(e2.brand,'')) as model
,concat(coalesce(e1.factory,''),' ',coalesce(e1.brand,'')) as pre_model
,e2.report_time as report_time
one row per match
after match skip to next row
pattern (e1 e2) within interval '7' day
define
e1 as e1.hw_type in (1,2,4),
e2 as e2.hw_type in (1,2,4) and e1.hw_type=e2.hw_type and (e1.factory<>e2.factory or e1.brand<>e2.brand)
);
B: select report_time
,mac
,hw_type
,model
,pre_model
from source_table
match_recognize(
partition by mac
order by report_time
measures
,e2.hw_type as hw_type
,concat(coalesce(e2.factory,''),' ',coalesce(e2.brand,'')) as model
,concat(coalesce(e1.factory,''),' ',coalesce(e1.brand,'')) as pre_model
,e2.report_time as report_time
one row per match
after match skip to next row
pattern (e1 e2) within interval '7' day
define
e1 as e1.hw_type in (1,2,4),
e2 as e2.hw_type in (1,2,4) and e1.hw_type=e2.hw_type and (e1.factory<>e2.factory or e1.brand<>e2.brand)
);
source_table_filter = from source_table where hw_type in (1,2,4)
求助一下关于Flink CEP的问题,当前的两个SQL, B能够输出想要的结果,A没有结果输出,这个原因有什么方法排查吗?
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
为了更好地理解您遇到的问题,请提供以下信息:
您的两个SQL查询(A和B)的具体内容。请提供完整的SQL查询语句,包括使用的CEP模式和相关的条件、窗口定义等。
输入数据的示例。提供一些示例数据,以便我可以更好地理解您的查询和数据之间的关系。
您期望的输出结果是什么?描述一下您希望从查询中获得的结果,以及当前的输出是否符合您的预期。
实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。