有没有办法从 match_recognize MEASURES 子句输出所有列?我尝试了以下方法:
1。
SELECT * FROM events MATCH_RECOGNIZE (PARTITION BY org_id ORDER BY proctime MEASURES A.* AS startId ONE ROW PER MATCH PATTERN (A C* B) DEFINE A AS A.tag = 'tag1', C AS C.tag <> 'tag2', B AS B.tag = 'tag2');
我得到的错误是:org.apache.calcite.sql.validate.SqlValidatorException: Unknown field '*'
SELECT * FROM events MATCH_RECOGNIZE (PARTITION BY org_id ORDER BY proctime MEASURES A AS start ONE ROW PER MATCH PATTERN (A C* B) DEFINE A AS A.tag = 'tag1', C AS C.tag <> 'tag2', B AS B.tag = 'tag2');
错误是:org.apache.flink.sql.parser.impl.ParseException: Encountered "start" at line 1, column 91.
有没有办法做这个操作?还是在 flink SQL 中不允许?似乎 flink 文档总是谈论最简单的情况,而从不考虑任何复杂的情况。